More exactly, you need to test one more thing:
fldTExt = FldGetTextPtr(fldP);
if (fldText && *fldText != '\0') {
// there is TEXT
}
else {
// no text entered
}
You need to test *fldText b/c if someone entered a single char then the Fld
will allocate space, but they may have deleted the character.
Alan Pinstein
Synergy Solutions, Inc.
http://www.synsolutions.com
1-800-210-5293
>Hi, folks! I have a question.
>
>How can I find out if a field has a string or not? I've been doing this;
>
>------------------------------------------------------------------------
>CharPtr fldStringPtr = FldGetTextPtr(GetObjectPtr(fieldID));
>
>if (fldStringPtr == NULL)
>{
> // Nothing in the field. do something.
>}
>else
>{
> // Something in the field. do something
>}
>------------------------------------------------------------------------
>
>Is this right method? Is there any simpler way to find out if the field is
>used or not?
>
>Thank you very much for taking the time to read my email. I really
>appreciate it.