This is a common question (that I asked not too long ago).  You can 
either use the FldDelete and FldInsert functions, or deal with the actual 
text handle for the field.  The following is a function I use to simplify 
things.  If anyone sees a problem w/ this code, please feel free to 
critique!

    Michael


void SetFieldText(FieldPtr fld, CharPtr fData)  {
        VoidHand fieldHandle;
        VoidPtr  fieldData;
        ULong size;

        if (FldGetTextPtr(fld))
                FldFreeMemory(fld);
        
        size = StrLen(fData) + 1;
        
        fieldHandle = MemHandleNew(size);
        fieldData = MemHandleLock(fieldHandle);
        
        StrCopy((CharPtr) fieldData, fData);
        MemHandleUnlock(fieldHandle);
        FldSetTextHandle(fld, (Handle) fieldHandle);
}

Reply via email to