Datasheet
stops execution only if the expression (i = j) And (i > 20) is True when the code reaches the break-
point. Note that specifying a breakpoint condition can slow execution considerably.
Figure 1-33: The Breakpoint Condition dialog lets you
specify a condition that determines whether Visual
Studio stops at the breakpoint.
Right-click a breakpoint and select Hit Count to display the Breakpoint Hit Count dialog shown in
Figure 1-34. Each time the code reaches a breakpoint, it increments the breakpoint’s hit count. You can
use this dialog to make the breakpoint’s activation depend on the hit count’s value.
Figure 1-34: The Breakpoint Hit Count dialog lets you
make a breakpoint’s activation depend on the number
of times the code has reached it.
From the drop-down list you can select the options “break always,” “break when the hit count is equal
to,” “break when the hit count is a multiple of,” or “break when the hit count is greater than or equal to.”
If you select any but the first option, you can enter a value in the text box and the program will pause
execution when the breakpoint has been reached the appropriate number of times. For example, if you
select the option “break when the hit count is a multiple of” and enter “2” into the text box, then execu-
tion will pause every other time it reaches the breakpoint.
Right-click a breakpoint and select When Hit to display the When Breakpoint Is Hit dialog shown in
Figure 1-35. This dialog lets you specify the actions that Visual Basic takes when the breakpoint is acti-
vated. Check the “Print a message” box to make the program display a message in the Output window.
Check the “Run a macro” box to make the program execute a VBA macro. Check the “Continue execu-
tion” box to make the program continue running without stopping.
31
IDE
571982 ch01_2.qxd 1/19/06 1:15 PM Page 31