>Posted by Kevin OKeefe
>It's probably better to use nulls to delimit strings, then you can use
normal Str functions and
>also don't have to worry about '|' appearing within a string.
I'd love to use the nulls however I'm creating the database on a Unix
machine from
an ascii file. I'm using a conversion utility for Unix called "pdbmake",
and it doesn't seem to
be converting the nulls properly.
>Posted by Chris Tutty
>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.
All the records are already sorted when being stored into the palmdb, so
I'm also creating an indexing database to refer to, to speed things up
in that respect. I'll see if I can muster up your idea though and test
it out...
"Chris Tutty" <[EMAIL PROTECTED]>
Sent by: To: "Palm Developer
Forum" <[EMAIL PROTECTED]>
[EMAIL PROTECTED] cc: (bcc: Nole Mailey/pmc)
palmos.com Subject: Re: Multiple
Text Records per PalmOS Record
07/08/2003 06:49 PM
Please respond to "Palm Developer
Forum"
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/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/