PA_Dial4DGetVariable

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

version 2003


PA_Dial4DGetVariable (dialog; variable) PA_Variable

ParameterTypeDescription
dialogPA_Dial4DDialog reference
variablechar*Name of the variable to access
Function resultPA_VariableThe variable structure of variable

Description

The routine PA_Dial4DGetVariable returns a PA_Variable embedding the value of the variable variable in the dialog referenced by dialog.

Note that it is probably much easier to use direct accessors to variable values, ie. PA_Dial4DGetDate, PA_Dial4DGetReal, PA_Dial4DGetArrayLong.

If PA_Dial4DGetVariable is called for a non-existing variable, the variable type is set to eVK_Undefined.

By default, variable needs to be a null terminated C string. If you have previously called PA_UsePStrings, you must pass a Pascal string to the command.

By default, variable needs to use Macintosh characters set on Macintosh, and ANSI characters set under Windows. You can call PA_UseMacCharacters or PA_UseAnsiCharacters to specifically use Macintosh or ANSI characters.

WARNING

The handles received for Text, Pictures, and BLOBs belong to 4th Dimension. You should never dispose of them.

Example

Check the value of "aVar", in the dialog dRef.

   PA_Variable   v;

   v = PA_Dial4DGetVariable( dRef, "aVar" );
   if ( PA_GetVariableKind( v ) == eVK_Longint )
   {
      if ( PA_GetLongintVariable( v ) == 3 )
      {
         /* . . . */
      }
   }

See Also

PA_Dial4DSetVariable.

Error Handling

None.


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