I'm trying to set the text of a multiline field that is not editable.
My question is: how do I send newline code to this field?

For example:
I have the string:
Char message[100]="This is\n a three lined \n message";

And then I want to store this message in my field. I have already done this
task when using single line messages (i.e. does not contain '\n' char). But
when I use this same procedure to show multiline message it shows a small
square in place of the \n char.

I'm using the code below.

Thanks
Leonardo Holanda.

void CopyStringToField( const Char * text, UInt16 fieldID)
{
   Char*   txtPtr;
   FormPtr  frm = FrmGetActiveForm( );
   FieldPtr fldP;

   fldP = FrmGetObjectPtr(frm, FrmGetObjectIndex( frm, fieldID ) );
   txtPtr = FldGetTextPtr( fldP );
  FldSetTextPtr( fldP, NULL );
   if( txtPtr )
   {
      MemPtrFree( txtPtr );
   }
   txtPtr = MemPtrNew ( StrLen(text)+1);
   StrCopy(txtPtr, text);

   FldSetTextPtr( fldP, txtPtr );
   FldDrawField( fldP );
}



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to