Debugging Macros

Instead of specifying an expression to watch using the Add Watch dialog box, you can set watches on expressions within your code or on the values of variables using the Quick Watch dialog box. The Quick Watch option works well for checking the value of a particular expression or variable while in Break mode.

To use the Quick Watch option to check the value of a variable, click next to the variable name and then press Shift+F9 to display the Quick Watch dialog box. The Quick Watch dialog box displays the selected expression and indicates the value of the expression at the current break point. If you want to continue to monitor the variable value, click Add to add the watch to the Watches window.

When dealing with a specific code expression, such as X > 5, the value on the Quick Watch dialog box is either true or false, indicating whether the expression is valid. For example, if the current value of X is 6, the expression has a value of true because 6 is greater than 5.

■ The Add Watch dialog box displays.

S Click an option for the desired type of watch (O changes to ®).

■ The Watches window lists each watch.

■ The Add Watch dialog box displays.

Type the expression to watch in the Expression field.

S Click an option for the desired type of watch (O changes to ®).

■ The Watches window lists each watch.

-■ The value of the watch expression displays in the Watches window.

0 0

Post a comment