Odd problem you have here.  I have a worked with a few field objects using
FldEraseField.  This seemed to do the trick.  But if you hav continued
problems a quick fix is always to add a couple of spaces after the fields
text.

This will "cover up" its previous value even if it isn't erased.  If you
need to get the value of the field again, just trim off the spaces.

Just a quick fix.


-----Original Message-----
From: Morten Schmidt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 28, 2004 9:36 AM
To: Palm Developer Forum
Subject: Re: Erase Field

If this is what you wish to do, I always have these functions in my proggies
to handle this:

[snip]
void *GetObjectPtr(UInt16 ownerForm, UInt16 fieldName)

{

return
FrmGetObjectPtr(FrmGetFormPtr(ownerForm),FrmGetObjectIndex(FrmGetFormPtr(own
erForm),fieldName));

}

void SetEditText(UInt16 ownerForm, UInt16 fieldName,Char *text)

{

FieldPtr THIS = GetObjectPtr(ownerForm, fieldName);

MemHandle h,old;

Char *dest;

if( text == NULL )

text = "";

h = MemHandleNew( StrLen( text ) + 1 );

dest = MemHandleLock( h );

StrCopy( dest, text );

MemHandleUnlock( h );

old = FldGetTextHandle( THIS );

FldSetTextHandle( THIS, h );

if( old != NULL )

MemHandleFree( old );

FldDrawField(THIS);

}

Char* GetEditText(FieldPtr THIS)

{

Char *text;

text=FldGetTextPtr(THIS);

if (!text)

text="";

return text;

}

[snap]

Then just:

SetEditText(frmMain, edtText, "");

for from frmMain and field edtText

/morten

"Morten Schmidt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What are you trying to do? Set the text to "" in the field or?
>
> /morten
>
>
>



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

Reply via email to