5.2. Modify the Value of a Watch Variable

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

  1. Select a variable to be modified.

  2. Do one of the following.


Click Debug>Modify on the Program Editor menu bar.


Press Alt+D+M on the keyboard.


Double-click the variable line in the Watch list.

A Modify Variable dialog box opens.

  1. Fill in the fields as follows.




Name of the variable to be modified.

Note: If the line was double-clicked the Name field:

Displays the selected variable.

Is read-only.


New value for the variable.

  1. Click OK or press Enter.

Result: The new variable value displays in the Watch list.

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.


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 (VarType 1)


Empty (VarType 0).


True (VarType 11).


False (VarType 11).


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 @.


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.

More information

5. Use a Watch variable.