In order:

* Check the result from FrmGetActiveForm.

* Check the result from FrmGetObjectPtr

* Check the result from FldGetTextPtr

* Check the result from MemPtrResize

Any one of those could fail, but you're not checking to see if they did.
MemPtrResize is particularly suspect. If all of those calls are working, you
might want to clarify what you mean by "the system returns garbage".

-- Keith

-----Original Message-----
From: J�lio F�bio de O. Chagas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 12:34 PM
To: Palm Developer Forum
Subject: Dynamic Field


I am trying to obtain the string text of a Field. This field was created on
the fly (run-time).
Every time when I try to do that, the system returns garbage.
I am using the code bellow:

    addrFieldP = FrmGetObjectPtr(FrmGetActiveForm(), curControl.fieldID-1 );
    buffer=FldGetTextPtr(addrFieldP);
    newSize=StrLen(buffer)+1;
    MemPtrResize(curForm.fieldData[curControl.fieldID],newSize);
    StrCopy(curForm.fieldData[curControl.fieldID],buffer);

--
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