LOL well at least this thread has been well walked over. Learning to program PDA's is a departure from my C++ for sure Code is similar, but the limited defined structure is at least a challenge to make you think outside the box. Thanks for everyones help in clearing this up. Remembering that a db in a PDA is just a memory chunk and not a real set of fields in a real database file is something that keeps messing me up. we're really bad eggs. Drink up me hardies yo-ho
Logan Shaw <[EMAIL PROTECTED]> wrote .. > [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/ -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
