Fields and their text is a complicated subject. You are violating one of its fundamental precepts.
In short, a field needs a handle for its text, NOT just a pointer. FldSetText is a convenience routine. The pointer you pass it MUST have been gotten from a handle via MemHandleLock. Using a string literal is a no-no. I would suggest that you do some general reading on fields and how they relate to the text they contain. Check out the PalmOSReference section on fields -- especially some of the stuff on FieldType and various of the functions. -bob mckenzie, palmsource pdx -----Original Message----- From: Jordon Marshall [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 10:11 AM To: Palm Developer Forum Subject: Fatal Exception -- HELP I am very new to Palm development, and I am having some pretty big problems. I am trying to search the following array to find a number that matches the users input into a field. The problem is that the code below gives me a "Fatal Exception". The problem that I am encountering is that this error is not consistant in any way. Some times it will happen when I input a number once, other times it takes 20 or more tries to break it. Anyone have any input to help a newbie. Try not to go too far over my head if you reply, I understand C++ very well but not Palm OS. Thank You char array_of_store_numbers[950][10] = { "6489", "14280", "16496", "21374", "5006", "5186", "2666", "14262", "5332", "15684", "18058", "20938", "19158", "19952", "21375", "17387", "18045", "17755", "19576", "20999",........ while(array_of_store_numbers[counter][0] != '\0' && !found) { if(strcmp(array_of_store_numbers[counter], temp_store_number) == 0) { found = 1; FldSetInsPtPosition(GetObjectPtr(StoreCheckAcctField),0); FrmSetFocus(FrmGetActiveForm(),StoreCheckAcctField); FldGrabFocus(GetObjectPtr(StoreCheckAcctField)); SetFieldText( StoreCheckAcctField, "-LOWES", 79, true ); } counter++; } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
