It sounds like you might be avoiding a more direct use of the data manager
because you believe that database records must all be the same fixed length.
That's not so: each database record can be a different length. For example,
the Memo Pad application puts each memo in it's own record in the memo
database. Instead of storing a reference to a separate chunk of memory for
your string, just put the string directly in the database where it is
referenced.

You might not want to do this if you have multiple references to the same
string. In that case, I recommend creating references to database records
based on the unique ID of the record. At one time, unique IDs weren't
preserved after a hard reset and restore via HotSync, but that was a long
time ago. Modern versions of Palm desktop and HotSync software for both Mac
and PC preserve the unique IDs of records. Finding a record by unique ID is
easy to do in code, but requires a linear scan of the records, which can be
prohibitively slow. Sometimes a cache of the record index is useful to
improve performance.
-- 
Peter Epstein

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

Reply via email to