[EMAIL PROTECTED] wrote:
Logan Shaw <[EMAIL PROTECTED]> wrote ..

druid wrote:

Yea, but that brings up another question
If the structure of a record is actualy a series on
teminated strings, when you retrieve records, how do you
know the length of any field in that record

You just have to figure out a way to do this yourself.

You mean that a record is not normally just a single string
with delimiters
Like this
size = StrLen(name)+1+ StrLen(level)+1;
   index = dmMaxRecordIndex;
   h = DmNewRecord(dbPtr, &index, size);
   ptr = MemHandleLock(h);
   Offset = 0;
   DmWrite(ptr, Offset, (const void *)name, StrLen(name)+1);
   Offset += StrLen(name)+1;
   DmWrite(ptr, Offset, (const void *)level, StrLen(level)+1);
   err = DmCloseDatabase(dbPtr);

maybe im doing this all wrong

Um, actually I think you are doing exactly the same way I suggested,
except that you are calling DmWrite() several times, whereas I put
everything into a for loop to generalize it a little bit.

So, I don't think you're doing it all wrong.  At least, if you are, then
that means I am too, and you should probably ignore my advice...  :-)

  - Logan

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

Reply via email to