PA_Dial4DGetLong


version 2003


PA_Dial4DGetLong (dialog; variable) → long

Parameter Type Description
dialog PA_Dial4D Dialog reference
variable char* Name of the variable to access

Description

The routine PA_Dial4DGetLong gets the value of a variable whose name is variable and returns its value as a long integer. This command is preferred over the PA_Dial4DGetVariable call because it handles the type casting for the developer.

If this command is applied to an array, it will return the current element of the array.

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

By default, varName 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.

Example

Check the value of 3 radio buttons and return the one that is on.

   /* . . . previous code (PA_NewDialog, PA_OpenDialog, PA_ModalDialog, ...*/
 
   if ( PA_Dial4DGetLong( dialog, "radio_1" ) == 1)
      result = 1;
   else if ( PA_Dial4DGetLong( dialog, "radio_2" ) == 1)
      result = 2;
   else if ( PA_Dial4DGetLong( dialog, "radio_3" ) == 1)
      result = 3;

See Also

PA_Dial4DSetLong .

Error Handling

None.