PA_SetBooleanField


version 2003


PA_SetBooleanField (tNum; fNum; value)

Parameter Type Description
tNum short Table number of the field to access
fNum short Field number of the field to access
value char New value for the field

Description

The routine PA_SetBooleanField sets the value of the boolean field number fNum of the current record of table number tNum to value .

If the field is not a boolean field, the routine does nothing and sets an error in PA_GetLastError ().

Remember that 4D expects that False = 0 and True = 1.

Example

Use macros for True and False.

   #define FALSE4D   ((char)0)
   #define TRUE4D   ((char)1)
   void mySetBooleanField(short tNum, short fNum, char b)
   {
      if(b)
         PA_SetBooleanField(tNum, fNum, TRUE4D);
      else
         PA_SetBooleanField(tNum, fNum, FALSE4D);
   }

See Also

PA_GetBooleanField .

Error Handling

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