12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

400 Day 11<br />

NOTE<br />

In my op<strong>in</strong>ion, the Add speed menu item is not very useful. It is much<br />

easier to set a breakpo<strong>in</strong>t <strong>in</strong> the Code Editor than it is to add a<br />

breakpo<strong>in</strong>t via the Add command <strong>in</strong> the Breakpo<strong>in</strong>t list w<strong>in</strong>dow.<br />

Breakpo<strong>in</strong>ts can be enabled or disabled any time you like. You might disable a breakpo<strong>in</strong>t<br />

if you want to run the program normally for a while; you can then enable the breakpo<strong>in</strong>t aga<strong>in</strong><br />

later without hav<strong>in</strong>g to re-create it. Breakpo<strong>in</strong>ts that are disabled are ignored by the debugger.<br />

If you want to modify a breakpo<strong>in</strong>t, you can choose Properties from the primary Breakpo<strong>in</strong>t<br />

list speed menu. When you do, the Edit breakpo<strong>in</strong>t dialog box is displayed. (See Figure 11.3.)<br />

Figure 11.3.<br />

The Edit breakpo<strong>in</strong>t<br />

dialog box.<br />

The primary reason to modify a breakpo<strong>in</strong>t is to add conditions to the breakpo<strong>in</strong>t.<br />

(Conditional breakpo<strong>in</strong>ts are discussed <strong>in</strong> the section “Conditional Breakpo<strong>in</strong>ts.”) The New<br />

button <strong>in</strong> the Edit breakpo<strong>in</strong>t dialog box works <strong>in</strong> a curious way. If you click the New button,<br />

a breakpo<strong>in</strong>t will be set on the l<strong>in</strong>e conta<strong>in</strong><strong>in</strong>g the cursor <strong>in</strong> the Code Editor. This is not a<br />

particularly useful feature, so you can happily ignore the New button <strong>in</strong> the Edit breakpo<strong>in</strong>t<br />

dialog box.<br />

To remove a breakpo<strong>in</strong>t, you can select the breakpo<strong>in</strong>t <strong>in</strong> the breakpo<strong>in</strong>t list and then press<br />

the Delete key on the keyboard. To delete all breakpo<strong>in</strong>ts, right-click the mouse to br<strong>in</strong>g up<br />

the secondary speed menu and then choose Delete All from the speed menu.<br />

Now let’s take a look at the two breakpo<strong>in</strong>t types.<br />

Simple Breakpo<strong>in</strong>ts<br />

Breakpo<strong>in</strong>ts can be either simple or conditional. A simple breakpo<strong>in</strong>t will cause program<br />

execution to be suspended whenever the breakpo<strong>in</strong>t is hit. When you <strong>in</strong>itially set a<br />

breakpo<strong>in</strong>t, it is, by default, a simple breakpo<strong>in</strong>t. Simple breakpo<strong>in</strong>ts don’t really require<br />

additional explanation. When the breakpo<strong>in</strong>t is encountered, program execution pauses at<br />

the breakpo<strong>in</strong>t, and the debugger awaits your bidd<strong>in</strong>g. There’s no need to belabor the po<strong>in</strong>t.

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

Saved successfully!

Ooh no, something went wrong!