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.

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.

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

  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.

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.

More information

5. Use a Watch variable.