Setting the value of a variable
You may set or update the value of certain types of variables with the Janus and TN3270 Debuggers. The following types of variable values may be modified:
- String %variables
- Unicode %variables
- Float %variables
- Fixed %variables
- Longstrings (255 character limit)
- Global variables
- Screen and Image items
- Boolean enumeration variables (only True and False [case not important] are valid values)
Currently, only scalar variables may be set; array elements may not be set. In addition, most object variables may not be set.
To set the value of a variable with the Debugger:
- Add the variable to the Watch Window.
- In the Watch Window, right click the variable.
- If this type of variable can be set, and it is settable at this point in the execution of the program, the Change Value context menu option is enabled.
- 3. Select Change Value.
- A Set %var dialog box like the following displays, where %var is replaced by the variable you are modifying, and the variable's current value is displayed:
- 4. Specify the new variable value, and click Set or press the Enter key.
- The Watch Window is refreshed with the new value, Variable Set displays in the Status bar, and the new value becomes the current value of the variable in the program at the current point of program execution.
The setM204Data command is equivalent to right clicking a Watch Window item and selecting Change Value.
Note: Setting a new value in the Debugger follows the rules of User Language assignment. For example, specifying a text value for a float variable results in setting the variable to zero.
See Also: