Monitoring the Evaluation Results of an Expression

As you step through a program, you may want to monitor the values resulting from the evaluation of individual expressions.

To monitor variables during program execution

  1. From the Debug menu, choose Watch Last Evaluation.

    VLISP displays the Watch window, which shows the value of the *LAST-VALUE* IDE global variable. VLISP always stores the value of the last evaluated expression in the *LAST-VALUE* variable.

  2. In the text editor window containing yinyang.lsp, double-click on any occurrence of the variable name origin-y.
  3. Click the Add Watch button in the Watch window. VLISP passes the origin-y variable name to the Watch window and displays the current value of the variable in the window:

    If the Watch window is not already open and you want to view a variable's value, you can open the window by choosing View Watch Window from the VLISP menu.

    If you click the Watch window's Add Watch button without double-clicking on a variable name first, the following window appears:

    In this window, you can enter the name of the variable you want to view. VLISP may anticipate your choice by copying the name of the variable nearest the cursor into the window. If this is not the one you want to view, simply type over the name.

    VLISP updates the variables in the Watch window after each execution step.

  4. Click the Step Over button (or press SHIFT + F8) twice.

    In the Watch window, note how the value of origin-y changes. It was nil at first, but after execution it took on the value corresponding to the point you clicked in the AutoCAD window.