THE DEBUG MENU

The Debug menu contains commands that help you debug a program. These commands help you run the program in the debugger, move through the code, set and clear breakpoints, and generally follow the code’s execution to see what it’s doing and hopefully what it’s doing wrong.

GIVE ME A BREAK
A breakpoint is a line of code that is marked to temporarily stop execution so you can test the code and figure out what’s happening. The section “The Breakpoints Window” later in this chapter says a lot more about how to use breakpoints, but breakpoints are mentioned a lot between now and then so it’s useful to have some idea of what they are now.

Effectively using these debugging tools can make finding problems in the code much easier, so you should spend some time learning how to use them. They can mean the difference between finding a tricky error in minutes, hours, or days.

The commands visible in the Debug window change depending on several conditions, such as the type of file you have open, whether the program is running, the line of code that contains the cursor, and whether that line contains a breakpoint. The following list briefly describes the most important menu items available while execution is stopped at a line of code that contains a breakpoint:

  • Windows — This submenu’s commands display other debugging-related windows. This submenu is described in more detail in the following section, “The Debug ⇒ Windows Submenu.”
  • Continue — This command resumes program ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.