If the field is empty, NULL is returned from FldGetTextPtr().  Check for
this before calling
DmWrite().

-Ken

> ----------
> From:         Rochester, Dean[SMTP:[EMAIL PROTECTED]]
> Reply To:     Palm Developer Forum
> Sent:         Monday, February 12, 2001 4:14 PM
> To:   Palm Developer Forum
> Subject:      If the text field is empty...
> 
> If I have a field on a table that is blank, with this code have a problem?
> Since there is nothing in the field, will this have a problem?
> 
> // Get the text from a field
> static void getText( FieldPtr field, VoidPtr precord, Word offset )
> {
>       CharPtr         pfield; // CH.5 Pointer to field text
> 
>       // CH.5 Get the text pointer
>       pfield = FldGetTextPtr( field );
>       
>       // CH.5 Copy it
>       DmWrite( precord, offset, pfield, StrLen( pfield ) );
>       
>       // CH.5 We're done
>       return;
> }
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
> 

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

Reply via email to