Add Watch Command (Debug Menu)
See Also
Description
Displays a dialog box in which you enter a watch expression 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 mode .
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 Calls 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.
Help:
Adding, Editing and Deleting a Watch Expression
Calls Command (Debug Menu)
Instant Watch Command (Debug Menu)
Setting and Clearing Breakpoints
Programmer's Guide:
Chapter 9, "Debugging"