From: <[EMAIL PROTECTED]>
> If I use that pointer method, won't that mean that I'm search 
> through every single string?
> Because I'll only want to to a String comparison on the key field.
> 
If you want to reference each string directly (ie, without working
through the strings that preceed it) you'll need an index of some 
sort that gives you the offset of the start of each string.  Storing 
it at the start of each record will add two bytes per string to your 
storage overhead but will let you access each string directly.

Each record would then look something like:

UInt16 Count    two bytes storing the number of strings in the 
record (you need this to determine the length of the index array)
UInt16 Index[1]    actually an array Count items long where 
each item is the byte offset of the String from the start of the 
record.
...
String\0
String\0
...

To unpack you'd open the record, read the count and the index
array and then get a particular string using something like
&(Record.Index[n]) (off the top of my head).

It's a little more complex than that but not much.  If you've got
funding I could give you a price to write a code module that 
would do the indexing and access for you, letting you focus 
on what the application has to do with that data.  If this appeals 
to you just email me privately.

Chris Tutty

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

Reply via email to