5.5 Monitoring and Changing Variables

From the Source pane or the Monitors menu, you can add variables and expressions to the Monitors pane, so that you can keep track of how their contents change during program execution. You can add multiple variables and expressions to the Monitors pane from the Monitors menu.

To add a variable or expression to the Monitors pane from the Source pane

  1. In the Source pane, select or double-click the variable or expression you want to monitor. For this lesson, select CUSTNO.
  2. Right-click on the highlighted variable, and select Add to Program Monitor from the pop-up menu.

To add a variable or expression to the Monitors pane from the Monitors menu (Optional)

For this lesson we will not be adding an actual variable or expression from the Monitors menu. If you wish to familiarize yourself with this process, please note the steps below.

  1. In the Source pane, you may optionally select or double-click the variable or expression you want to monitor. If this step is completed, the variable or expression will appear in the Enter expression to be evaluated field of the Monitor Expression dialog box and entering the variable's name in this field will not be required.
  2. Select Monitors > Monitor Expression from the menu bar to invoke the Monitor Expression dialog box.
  3. If step 1 was not completed, enter the variable or expression you want to monitor in the Enter expression to be evaluated field.
  4. The Program monitor radio button is selected by default.
  5. Click OK to add the variable or expression to the monitor and dismiss the dialog box.

Modifying a variable's value

  1. After adding a variable to be monitored, click on the Monitors tab in the main debugger window.
  2. Double-click on the value of the variable CUSTNO. The field changes into an entry field.

  3. Type in the new value 0010100 for the variable CUSTNO and press Enter.

    The variable CUSTNO is successfully changed to 0010100.


Click on to indicate that you have completed these steps.