Doesn't that imply that the OS potentially has to update the local ID of
every record of every database whenever a database is created or deleted?  A
dbID is the card offset of the database header, just as a record's local ID
is the card offset of the record's chunk. Unless dbID's are special-cased,
if they can change, so can record local ID's.

In any case, the possibility that a given database could be deleted and
recreated, thus possibly ending up with a different dbID than originally,
means that dbID's can't be relied upon unless they have been obtained by
making an OS call (DmFindDatabase).

Just for fun, I wrote a test program that showed DmGetDatabase to be 3.5
times slower than DmFindDatabase when the last index tried (out of 140)
yielded a match, 2.3 times slower when half of the indexes had to be tried,
and 1.8 times _faster_ when the first index tried yielded a match.  This
best case scenario was the _only_ time that DmGetDatabase was faster than
DmFindDatabase.  It looks like the system keeps the list of databases in
alphabetical order, and uses a binary search in DmFindDatabase.

Mark Peters

"James" <[EMAIL PROTECTED]> wrote in message
news:83117@palm-dev-forum...
>
> Given a card number and a local ID, you can iterate through all the
> databases on the card with DmGetDatabase and check if any of them match
the
> local ID.
>
> I would expect this to be a /little/ bit faster than searching for the
> database by name.  However, I'm not certain if this is too useful, because
I
> think the local IDs can change as databaes get added or removed.  Even if
> the local ID is valid, I think it may not necessarily correspond to the
same
> database as it used to.
>
>
> "Mark A. Peters" <[EMAIL PROTECTED]> wrote in message
> news:83097@palm-dev-forum...
> >
> > Is there a way to determine if the database corresponding to a LocalID
> still
> > exists (without DmFindDatabase)?
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to