30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1306 <strong>Visual</strong> Studio .<strong>NET</strong> Debugger Appendix D<br />

Figure D.6 shows the IDE with program execution suspended at a breakpoint. The<br />

yellow arrow <strong>to</strong> the left of the statement<br />

x *= i<br />

indicates that execution is suspended at this line and that this line contains the next statement<br />

<strong>to</strong> execute. Note that the title bar of the IDE displays [break]—this indicates that the<br />

IDE is in break mode (i.e., the debugger is being used). Once the program has reached the<br />

breakpoint, you may “hover” with the mouse on a variable (in this case x or i) in the source<br />

code <strong>to</strong> see the value of that variable.<br />

Testing and Debugging Tip D.3<br />

Loops that iterate many times can be executed in full (without s<strong>to</strong>pping every time through<br />

the loop) by placing a breakpoint after the loop and selecting Start from the Debug menu. 24.0<br />

D.3 Examining Data<br />

<strong>Visual</strong> Studio .<strong>NET</strong> includes several debugging windows, all accessible from the<br />

Debug > Windows submenu. Some windows are listed only when the IDE is in break<br />

mode (also called debug mode). The Watch window (Fig. D.7), which is available only in<br />

break mode, allows the programmer <strong>to</strong> examine variable values and expressions. <strong>Visual</strong><br />

Studio provides a <strong>to</strong>tal of four windows that allow programmers <strong>to</strong> organize and view variables<br />

and expressions.<br />

Yellow arrow indicates next<br />

statement <strong>to</strong> be executed<br />

Title bar displays [break]<br />

Fig. D.6 Execution suspended at a breakpoint.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!