PA_GetTextField

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetTextField (tNum; fNum; text) long

ParameterTypeDescription
tNumshortTable number of the field to access
fNumshortField number of the field to access
textchar*Pointer to the text data
Function resultlongLength of the text

Description

The routine PA_GetTextField fills the buffer pointed to by text with the value of the field (of type text) number fNum of the current record of the table number tNum, and returns the length of the text.

If the field is not a text field, the routine leaves text unchanged, returns 0 and an error code in PA_GetLastError.

First call the routine, passing 0 in text to get the size of the text. Then, allocate the buffer and call the routine again to fill it.

Depending on default settings or on previous calls to PA_UseMacCharacters or PA_UseANSICharacters, text will contain Macintosh or ANSI characters.

Examples

Get the text of field 4 of table 2.

   char   *text;
   long   len;

   len = PA_GetTextField( 2, 4, 0 );
   if ( PA_GetLastError() == eER_NoErr )
   {
      text = malloc( len );
      if ( text )
      {
         len = PA_GetTextField( 2, 4, text );
         /* . . . */
         free( text );
      }
   }

See Also

PA_SetTextField, PA_UseAnsiCharacters, PA_UseMacCharacters.

Error Handling

Use PA_GetLastError to see if an error occurred (eER_InvalidFileNumber, eER_InvalidFieldNumber)


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next