Using a Watch to Set a Breakpoint

Right-click the glasses icon in the Watches window and choose Edit Watch. In the Watch Type section of the Edit Watch dialog, select Break When Value Changes (see Figure 2.37). Click OK.

Figure 2.37

Select Break When Value Changes in the bottom of the Edit Watch dialog.

Figure 2.37

Select Break When Value Changes in the bottom of the Edit Watch dialog.

The glasses icon has changed to a hand with triangle icon. You can now press F5 to run the code. The macro starts running lines of code until something new is selected. This is very powerful. Rather than having to step through each line of code, you can now conveniently have the macro stop only when something important has happened. A watch can also be set up to stop when the value of a particular variable changes.

0 0

Post a comment