PA_GetStringField


version 2003


PA_GetStringField (tNum; fNum; string)

Parameter Type Description
tNum short Table number of the field to access
fNum short Field number of the field to access
string char* Value of the field

Description

The routine PA_GetStringField returns in string the value of the field fNum of the current record of table tNum . Make sure that you have enough room to receive the string (usually, 4D developers use 256 chars buffers).

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

By default, PA_GetStringField fills string with a null terminated C string, unless you have previously called the PA_UsePStrings functions.

By default, PA_GetStringField fills string with Macintosh characters on Macintosh and ANSI characters under Windows, except if you have previously called the PA_UseMacCharacters or PA_UseAnsiCharacters function

Examples

User alert with the value of a string field.

   char value[256];
 
   PA_GetStringField( 1, 2, value ); // Assuming field 2 of table 1 is a string field
   if ( PA_GetLastError() == eER_NoErr )
      PA_Alert( value );

See Also

PA_SetStringField , PA_UseAnsiCharacters , PA_UseCStrings , PA_UseMacCharacters , PA_UsePStrings .

Error Handling

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