Hi,
If FldGetTextHandle returns NULL, the field it empty! 
However, I do not understand why you create a new handle h and then have the
OS overwrite it with the current text handle of the field. 
h = FldGetTextHandle(FieldPtr);
This line OVERWRITES your handle h with the fields handle-h doesn�t point to
the Handle you created anymore after this call!
Best Regards
Tam Hanna

Tony Janke wrote:

I use the following code to retrieve text from a field...

----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------
        h = MemHandleNew(50);           // allocate chunk of memory in
heap
        FieldPtr = FrmGetObjectPtr(pForm, FrmGetObjectIndex(pForm,
controlID));
        h = FldGetTextHandle(FieldPtr);
        p = MemHandleLock(h);           // prevent the chunk from moving
(lock) and obtain pointer to location
        MemHandleResize(h, StrLen(p)+1);
        MemHandleUnlock(h);
        return p;
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------
my question is how to check that the field is not empty.  If the field
is empty, I get a NULL handle error at the designated line.


thanks,

~Tony


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

Reply via email to