5.2. Modify the Value of a Watch Variable

About this task

When the debugger has control , you can modify the value of any of the variables on Program Editor's Watch variable list.

  • Procedure to modify variables.
  • Guidelines for modifying variables.

Procedure to Modify Variables

Procedure

  1. Select a variable to be modified.
  2. Do one of the following.
    A Click Debug>Modify on the Program Editor menu bar.
    B Press Alt+D+M on the keyboard.
    C Double-click the variable line in the Watch list.

    A Modify Variable dialog box opens.

  3. Fill in the fields as follows.
    Field Description
    Name Name of the variable to be modified. Note: If the line was double-clicked the Name field:
    • Displays the selected variable.
    • Is read-only.
    Value New value for the variable.
  4. Click OK or press Enter.

Results

The new variable value displays in the Watch list.

guide: Guidelines for Modifying Variables
  • When changing the value of a variable, the Program Editor converts the new value to be of the same type as the variable being changed.

Example

An Integer value is 3.

1.7 is entered in the Value field

The Program Editor converts the new value to 2.

  • When modifying a Variant variable, the Program Editor needs to determine both the type and value of the data. Program Editor uses the following logic in performing this assignment (in this order):
If the new value is The variant variable is assigned:
Null Null (VarType 1)
Empty Empty (VarType 0).
True True (VarType 11).
False False (VarType 11).
number The value of number. The type of the variant is the smallest data type that fully represents that number. You can force the data type of the variable using a type-declarator letter following number, such as %, #, &, !, or @.
date The value of the new date (VarType 7)
Anything else String (VarType 8).
  • The Program Editor will not assign a new value if it cannot be converted to the same type as the specified variable.