Hi,
Is it safe to store the local id of a record and access it later? Does it
ever change?
What I am doing is indexing a database using a separate "index" database.
This "index" database stores an id string and the local id of the record in
the other database. I can then do a binary search to locate the key and
then read the local id of the record. At this point I would call
MemLocalIDToGlobal() to convert the records local id to a global handle and
then I call DmSearchRecord() to get the record ordinal position. See below
for details.
Read 'localID'
DmOpenRef dbRefFound;
VoidHand hRec = (VoidHand)MemLocalIDToGlobal(localID, eCardNum);
if (hRec)
{
Int index = DmSearchRecord(hRec, &dbRefFound);
Ordinal = (UInt)index;
}
Is there a better way to implement an index?
By the way, I have stayed away from DmFindRecordByID() because all it does
is a sequential search through the database.
Thanks,
Chris
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html.