> When do you plan to close the database? How is anybody going to
> delete your (open) database if they wish to remove your hack? There

as long as i don't use dmModeLeaveOpen, then there is just not a problem,
because SysAppExit closes ALL databases.  good point though, in that i can't
use dmModeLeaveOpen.

> are potentially problems with flashing the database (may not be
> appropriate anyway), installing a new version (ditto), or backing up
> the database withit marked as open.

again, nope, b/c all databases get automatically closed by SysAppExit unless
they have dmModeLeaveOpen (which i'm not using at the moment, but was
considering until you pointed out that it's a dumb idea.  :-)

> I don't think that opening the database is going to slow your hack
> down much compared to the act of searching the database on every
> keyDown.

i double checked the OS source, and DmOpenDatabase does enough work that i
have to disagree.  searching the database is only O(log2(n)) where n is
number of records in database.  opening the database is O(m + n + z) where m
is the total number of open databases/apps (probably about 3 at any given
time?), n is the number of records in the database (it walks every record in
order to cache a count of records -- granted the time spent per n here is
much less than the time spent per n during the search), and z is a bunch of
more or less constant time additional work done by DmOpenDatabase.  if it's
safe to avoid doing an open with every keyDownEvent, then why the heck not.
and it does seem to be perfectly safe, provided i don't use dmMoveLeaveOpen.


Reply via email to