I have a single record database, and I'm using this function to retrieve the
data from the form fields.
Once in a blue moon, when I'm leaving a form, it causes a Fatal exception.
The data is still saved... but I'm not sure what is causing it. Is my
storing procedure correct? It seems to work fine.
void SetGeneral(FormPtr frm)
{
tblInfo theInfo;
VoidHand record = DmGetRecord(gInfoDB, 0); // Hardcoded to first
record
tblPackedInfoPtr p = MemHandleLock(record);
UnpackInfo(&theInfo, p);
StrCopy(theInfo.TripNumber, FldGetTextPtr(FrmGetObjectPtr(frm,
FrmGetObjectIndex(frm, NfoGeneralTripNumberField))));
StrCopy(theInfo.TruckNumber, FldGetTextPtr(FrmGetObjectPtr(frm,
FrmGetObjectIndex(frm, NfoGeneralTruckNumberField))));
StrCopy(theInfo.Driver, FldGetTextPtr(FrmGetObjectPtr(frm,
FrmGetObjectIndex(frm, NfoGeneralDriversNameField))));
PackInfo(&theInfo, record);
MemHandleUnlock(record);
DmReleaseRecord(gInfoDB, 0, false);
}
--
Tim Astle
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html