MARGIN ICONS

The gray margin to the left of the line numbers contains icons giving information about the corresponding lines of code. The following table describes the icons on lines 4 through 13.

LINE ICON INDICATES
4 Arrow Execution is paused at this line
5 Red circle A breakpoint
6 Hollow red circle A disabled breakpoint
7 Red circle with plus sign A breakpoint with a condition or hit count test
11 Red diamond A breakpoint that executes an action when reached
12 Gray ribbon A bookmark
13 Hollow diamond and plus sign A disabled breakpoint with a hit test or condition that performs an action

BREAK TIME
A breakpoint is a line of code that you have flagged to stop execution so you can test and debug the program. When you run the program in the IDE, the program stops at the breakpoint and lets you see what routines called what other routines, examine variable values, change variables, and so forth to figure out what’s happening. For more information on breakpoints and debugging, see Chapter 6, “Debugging.”

These icons can combine to indicate more than one condition. For example, line 13 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. It surrounds lines with disabled breakpoints with red boxes.

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 set only 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.
  • Edit Labels — Lets you add labels to a breakpoint. Later you can select this option to view, change, or remove the breakpoint’s labels.
  • Export — Lets you export information about the breakpoint into an XML file.

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, at the top of the Bookmarks window (View ⇒ Other Windows ⇒ Bookmark ⇒ Window), and in the Edit menu’s Bookmarks submenu. 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. Still others let you disable all bookmarks and delete a bookmark.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.155.130