One (bloated) way to do it would be
Char Question1Answer[32]; Char Question2Answer[32]; Char Question3Answer[32]; etc. UInt8 sessionFinished;
Another (nicer) way to do it would be
UInt8 sessionFinished; Char QuestionsText[1];
(note that QuestionsText must be at the end of the record)
Then call DmResizeRecord as necessary to get the true record size to match what's needed based on the total length of all question texts. QuestionsText is defined as a one-element array, but would actually be a few hundred characters. Its content would be something like
"Answer to question one\0Ans to Q2\0\0Answer to 4\0\Five\0Six\0" (null-terminated strings for each answer)
Q1offset = 0 Q2offset = 23 Q3offset = 30 Q4offset = 30 Q5offset = 41 Q6offset = 45 StrLen(QuestionsText) is 48 QuestionsText needs 49 elements for space for the final NULL
(more or less, I didn't count chars exactly; note that Q3 wasn't answered)
I'm sure there's an OS function that builds the Q...Offset values, and it's driving me nuts that I can't find/remember the name of it.
I don't know why switching to StrCopy makes a difference. My hunch is that you're getting away with it but it's not really working. You are running on a debug ROM, right?
H
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
