Datasheet

Script Explorer — This command displays the Script Explorer, which can help you debug script
code written in VBScript or JScript.
Processes — This window lists processes that are attached to the Visual Studio session. This
includes any programs launched by Visual Studio and processes that you attached to using
the Debug menu’s Attach to Process command.
The Breakpoints Window
A breakpoint is a line of code that you have flagged to stop execution. When the program reaches that line,
execution stops and Visual Studio displays the code in a code editor window. This lets you examine or
set variables, see which routine called the one containing the code, and otherwise try to figure out what
the code is doing.
The Breakpoints window lists all the breakpoints you have defined for the program. This is useful for
a couple of reasons. First, if you define a lot of breakpoints, it can be hard to find them all later. While
other commands let you disable, enable, or remove all of the breakpoints at once, there are times when
you may need to find a particular breakpoint.
A common debugging strategy is to comment out broken code, add new code, and set a breakpoint near
the modification so that you can see how the new code works. When you have finished testing the code,
you probably want to remove either the old or new code, so you don’t want to blindly remove all of the
program’s breakpoints. The Breakpoints window lists all of the breakpoints and, if you double-click a
breakpoint in the list, you can easily jump to the code that holds it.
The Breakpoints window also lets you modify the breakpoints you have defined. Select or clear the boxes
on the left to enable or disable breakpoints. Use the dialog’s toolbar to enable or disable all breakpoints,
clear all breakpoints, or jump to a breakpoint’s source code.
Right-click a breakpoint and select Condition to display the dialog shown in Figure 1-31. By default,
a breakpoint stops execution whenever it is reached. You can use this dialog box to add an additional
condition that determines whether the breakpoint activates when reached. In this example, the break-
point stops execution only if the expression
(i = j) And (i > 20) is True when the code reaches
the breakpoint. Note that specifying a breakpoint condition can slow execution considerably.
Figure 1-31: The Breakpoint Condition dialog box
lets you specify a condition that determines whether
Visual Studio stops at the breakpoint.
31
Chapter 1: IDE
37055c016.qxd 4/8/07 12:46 PM Page 31