This may give some idea of what to do, in general.  After getting the handle to 
the field text, be sure to set the Field's text handle to NULL.  Otherwise, 
things can get messed up while you're doing your processing on the text.

In my experience, the field will retain its text, as long as you don't close 
the form the field is in.  However, if you go to another form and come back, 
you may need to redraw the field.

static void DoFieldStuff(FieldPtr MyField)
{
   MemHandle hMem;
   char *pMem;

   // Get the Field text
   hMem = FldGetTextHandle(MyField);
   FldSetTextHandle(MyField, NULL);  // Important!
   pMem = MemHandleLock(hMem);

   // At this point, we do our desired operations
   // on pMem

   // Put text back into field
   MemHandleUnlock(hMem);
   FldSetTextHandle(MyField, hMem);
}
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to