I use this piece in my code.  It takes care of all the memory management and resource finding.  I find I'm running a collection of common functions I'm moving from project to project.

void EditFieldRead(FormPtr frmP, int ctrl_id, char *pInputBuffer)
{
    FieldPtr FieldCtlP = (FieldPtr) GetObjectPtr(frmP, ctrl_id);
    VoidHand textHandle = (VoidHand) FldGetTextHandle(FieldCtlP);
    char *pText = (char *) MemHandleLock(textHandle);
    int len = StrLen(pText);
 
    if(len > 0)
    {
        MemMove(pInputBuffer, pText, len + 1); // Grabs the terminating NULL
    }
    else
    {
        *pInputBuffer = NULL;
    }

    MemHandleUnlock(textHandle);
}

Webmaster wrote:

whats the easiest way to grab text from a Field and pass it to a string.
also, does anyone know  a simple way to check a string for a decimal and
remove it from the string?

Joe Jenkins
palm newbies -r- us
Qqest Software Systems

Reply via email to