PA_Dial4DSetString


version 2003


PA_Dial4DSetString (dialog; variable; newValue)

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

Description

The routine PA_Dial4DSetString sets the value of a variable whose name is variable to the value in newValue . This command is preferred to the PA_Dial4DSetVariable call because it handles the type conversion for you.

By default, variable and varValue are null terminated C strings. If you have previously called PA_UsePStrings, the command will expect Pascal string.

By default, variable and varValue 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.

In order that 4th Dimension knows it must redraw the dialog, all PA_Dial4DSetxxx routines must be squared by calls to PA_Dial4DBeginUpdateVariables and PA_Dial4DEndUpdateVariables .

Example

Set a default value to a string variable, if it was empty.

   /* . . . previous code . . . */
   if ( Dial_IsEmptyString( dial, "aVariable" ) ) // see example in PA_Dial4DGetString
   {
      PA_DialBeginUpdateVariables( dial );
      PA_Dial4DSetString( dial, "aVariable", "the default value" );
      PA_Dial4DEndUpdateVariables( dial );
   }

See Also

PA_Dial4DGetString .

Error Handling

None.