PA_SetBooleanVariable

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

version 2003


PA_SetBooleanVariable (aVariable; newValue)

ParameterTypeDescription
aVariablePA_Variable *Pointer to the variable to access
newValuecharNew value for aVariable

Description

The routine PA_SetBooleanVariable sets the content of the boolean variable pointed to by aVariable to newValue.

WARNING

The kind of variable pointed to by aVariable is set to eVK_Boolean by the routine, even if it was not its previous kind.

Make sure that you do not change 4D variable kinds (using PA_GetVariable), especially in compiled mode.

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

Example

Use macros for True and False.

   #define FALSE4D   ((char)0)
   #define TRUE4D   ((char)1)
   void mySetBooleanVariable(PA_Variable *v, char b)
   {
      if(PA_GetVariableKind(*v) == eVK_Boolean)
      {
         if(b)
            PA_SetBooleanVariable(v,TRUE4D);
         else
            PA_SetBooleanVariable(v,FALSE4D);
      }
   }   

See Also

No reference.

Error Handling

PA_GetLastError keeps the last error that occurred before calling the routine.


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