Add Watch Command (Debug Menu)

See Also1UHBIDA

Description

Displays a dialog box in which you enter a watch expression12QVKFC.  The expression can be any valid Basic expression.  Watch expressions are updated in the upper pane of the Debug window each time you enter break mode9NQX0JY.

When selecting a context for a watch expression, use the narrowest scope that fits your needs.  Selecting Global or Form/Module could slow your program considerably, since Visual Basic evaluates the expression after executing each line of code.  Selecting Procedure for a context will affect execution only while the selected procedure is in the list of active procedure calls, which you can see with the CallscmdDebugCalls command on the Debug Menu.

Dialog Box Options

Expression

Enter the expression to be watched.  The default is the term that was selected when you chose the command.

Context

Procedure

    The expression is evaluated after executing every line of code while the procedure is in the call tree.

Form/Module

    The expression is evaluated after executing every line of code.

Global

    The expression is evaluated after executing every line of code.

Watch Type

Watch Expression

    The expression and its value appear in the upper pane of the Debug window.

Break when Expression is True

    Execution automatically breaks whenever the expression evaluates to True or any nonzero value (not valid for string expressions).

Break when Expression has Changed

    Execution automatically breaks whenever the value of the expression changes.


See Also

Help:

Adding, Editing and Deleting a Watch Expression1Z5654F

Calls Command (Debug Menu)cmdDebugCalls

Instant Watch Command (Debug Menu)cmdDebugInstantWatch

Setting and Clearing BreakpointsBMA26TM

 

Programmer's Guide:

Chapter 9, "Debugging"