Thanks Robert. Very good point (how often I've hit my head against a wall for missing that one)!
DmRecordInfo could also be used to test for the state of the record (deleted, archived etc). I am not sure if all releases of PalmOS handle deleted records safely if they are queried (ie. Could it display a fatal alert instead?). Either way, it may be the safest option in the long run. As far as MemHandleSize, it usually throws ugly fatal alerts with NULL handles. Just about all the memory manager functions do this with NULL handles, so always best to test them ;) ... Cheers Brian -----Original Message----- From: Robert McKenzie [mailto:[EMAIL PROTECTED]] Sent: 13 August 2002 17:10 To: Palm Developer Forum Subject: RE: error with reading database There is another potential problem with the code below, with will or will not manifest depending on the state of the database in question. That is to say, if the record contains deleted records (in particular records for which DmDeleteRecord has been called), then (1) those records will still be in the database (i.e., DmNumRecord call will include them), (2) the DmQueryRecord will return a null handle. Off the top of my head, I am not sure what MemHandleSize will return when passed a null handle, but 0 is by no means out of the question. I wouldn't want to bet what SerSend will do when passed a null handle and a size parameter of 0 either. Probably safest to just check the DmQueryRecord call's returned handle for NULL and only execute the send stuff when it is non-null. -bob mckenzie, palmsource pdx -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
