Step through your program using the debugger.  Check the value of UniqueID
when you get to the VoidHand declaration.  It sounds as though you are
asking for a record index that does not exist (yet).  How are you setting
the value of UniqueID?

Regards,

Steve

-----Original Message-----
From: Timothy Astle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 13, 2000 2:24 PM
To: Palm Developer Forum
Subject: Bewildered...


CharPtr GetTripTripNumber(UInt UniqueID)
{
     CharPtr c;
     tblTrip theTrip;

     VoidHand record = DmGetRecord(gTripDB, UniqueID);
     tblPackedTripPtr p = MemHandleLock(record);
     UnpackTrip(&theTrip, p);
     StrCopy(c, theTrip.TripNumber);
     MemHandleUnlock(record);

     return(c);
}


This function has been causing me much grief :-)  Here's what I've
encountered thus far:

#1 It warns me that I should initialize CharPtr c before using it. (why??)
#2 When I use DmGetRecord, I get an "Index out of Range" error, requiring a
hard boot
#3 If I change DmGetRecord to DmQueryRecord, and comment out all the other
code, I get a different error.  (NULL based error, probably due to the fact
I hard coded a NULL for a return value :-)

Now, I've heard something about clearing the busy bit... perhaps this has
something to do with my problem?  I am aware that DmQueryRecord doesn't set
the busy bit...

Tim



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to