>From Palm DOC the function FldGetTextPtr will return NULL if there is no Text on the Field, Such that you may check the return str before its StrLen function applied.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bill Skellenger Sent: Monday, March 04, 2002 9:50 AM To: Palm Developer Forum Subject: Reading from "low memory" -- sample code -- need guidance! It seems that the following code: static void MyFunc() { UInt16 objIndex; FieldPtr fldptrAmount; char *amount; frm = FrmGetActiveForm(); // Get user's amount input objIndex = FrmGetObjectIndex(frm, fldAmount); fldptrAmount = FrmGetObjectPtr(frm, objIndex); FormatAmount(fldptrAmount, MaxDecimalPlaces); amount = FldGetTextPtr(fldptrAmount); ... } ...is giving me a problem only in FormatAmount() if fldAmount doesn't contain any data. The first few lines are where POSE is telling me that I'm reading from low memory: static void FormatAmount (FieldPtr fld, UInt16 decimalPlaces) { Int16 len; Char * str; str = FldGetTextPtr (fld); len = StrLen (str); if (!len) return; ... } But as I mentioned, if the field contains data, POSE executes this normally. I don't think it's a POSE problem, that's why I'm posting here -- I think it's a general problem with the way I've coded this... Thanks for any help in advance, --Bill -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
