Datasheet

These icons can combine to indicate more than one condition. For example, line 12 shows a blue and
white rectangle to indicate a bookmark, a hollow red diamond to indicate a disabled breakpoint that
performs an action, and a plus sign to indicate that the breakpoint has a condition or hit count test.
Note that the editor marks some of these lines in other ways than just an icon. It highlights the currently
executing line with a yellow background. It marks lines that hold enabled breakpoints with white text
on a red background.
To add or remove a simple breakpoint, click in the gray margin.
To make a more complex breakpoint, click in the margin to create a simple breakpoint. Then right-click
the breakpoint icon and select one of the context menu’s commands. The following list describes these
commands:
Delete Breakpoint — Removes the breakpoint.
Disable Breakpoint — Disables the breakpoint. When the breakpoint is disabled, this command
changes to Enable Breakpoint.
Location — Lets you change the breakpoint’s line number. Usually it is easier to click in the
margin to remove the old breakpoint and then create a new one.
Condition — Lets you place a condition on the breakpoint. For example, you can make the
breakpoint stop execution only when the variable
num_employees has a value greater than 100.
Hit Count — Lets you set a hit count condition on the breakpoint. For example, you can make
the breakpoint stop execution when it has been reached a certain number of times.
Filter — Lets you restrict the breakpoint so it is only set in certain processes or threads.
When Hit — Lets you specify the action that the breakpoint performs when it triggers. For
example, it might display a message in the Output window or run a macro.
To add or remove a bookmark, place the cursor on a line and then click the Toggle Bookmark tool. You
can find this tool, which looks like the blue and white bookmark icon, in the Text Editor toolbar (under
the mouse in Figure 1-54) and at the top of the Bookmarks window. Other bookmark tools let you move
to the next or previous bookmark, the next or previous bookmark in the current folder, or the next or
previous bookmark in the current document. The final bookmark command clears all bookmarks.
Outlining
By default, the code editor displays an outline view of code. If you look at the first line in Figure 1-53,
you’ll see a box with a minus sign in it just to the right of the line number. That box represents the outlin-
ing for the
Form1 class. If you click this box, the editor collapses the class’s definition and displays it as a
box containing a plus sign. If you then click the new box, the editor expands the class’s definition again.
The gray line leading down from the box leads to other code items that are outlined, and that you can
expand or collapse to give you the least cluttered view of the code you want to examine. Near the bot-
tom of Figure 1-54, you can see that the
RandomizeArray subroutine has been collapsed. The ellipsis
and rectangle around the routine name provide an extra indication that this code is hidden.
The editor automatically creates outlining entries for namespaces, classes and their methods, and mod-
ules and their methods. You can also use the
Region statement to group a section of code for outlining.
57
Chapter 1: IDE
37055c016.qxd 4/8/07 12:46 PM Page 57