Thanks for the response -- Found it shortly after I posted it. StrLen was attempting to find the length of a NULL pointer.
:) --Bill lklee wrote: > > 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/ -- *** MY PERSONAL E-MAIL ADDRESS IS CHANGING!! *** "[EMAIL PROTECTED]" will be changed to "[EMAIL PROTECTED]" Effective 27-Jan-2002. The forwarding service I was using for the old address is now going to charge users for this service! I will still be able to get e-mail sent to the old address, but I will be forced to use a web-based service to do so. Please update your address book with the new address. Thank you!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
