Hi All, I had changed the codes in my program. Although I can compile successfully, 
when I debug on POSE, I had to do a reset whenever I tap on the dynamic list. After 
setting a few breakpoints below, I noticed the variable (*rec) "contains" garbage. I 
step-over the breakpoint, but at MemHandleUnlock, I had to do a reset. 

typedef struct { 
    Int32 ID;
    const char *Class;
    const char *Name;
    const char *Gender;
 } StudentRecord;

//Dynamic List Function
for (indx=0; indx < NumRecor; indx++)
{
        
  RecordHa = DmQueryRecord(name, indx);
  rec = (StudentRecord *) MemHandleLock(RecordHa);//breakpoint
  RecordPointr = rec->Name + StrLen(rec->Name) + 1;
  MemHandleUnlock(RecordHa);//breakpoint
}  

I managed to find similar problems like this in the archives, but none of them provide 
a solution to it. One of them mention: "Your structure does
not contain any space to store a string.  "Char *Name " only declares a pointer to 
Char.  You have to allocate space somewhere to store the string,
and assign the address of that string to Name(in this case).  Also, when you write 
your structure to the database, you will be saving the pointer, not the string of 
characters." But this only adds more question marks above my head, can someone 
understand this or tell me what did I did wrong?


Many Thanks
Regards, 
Lauren


____________________________________________________________
Tired of all the SPAM in your inbox? Switch to LYCOS MAIL PLUS
http://www.mail.lycos.com/brandPage.shtml?pageId=plus

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

Reply via email to