PA_Dial4DSetString

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

version 2003


PA_Dial4DSetString (dialog; variable; newValue)

ParameterTypeDescription
dialogPA_Dial4DDialog reference
variablechar*Name of the variable to access
newValuechar*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.


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