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

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

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

NOTE<br />

Us<strong>in</strong>g the Debugger<br />

<strong>in</strong> the Evaluate field and press Enter, the result, 768, will be displayed<br />

<strong>in</strong> the Result field.<br />

You can also enter logical expressions <strong>in</strong> the Evaluate field and have the<br />

result shown <strong>in</strong> the Results field. For <strong>in</strong>stance, if you entered<br />

20 * 20 == 400<br />

the Result field would show true. The only problem with this scenario<br />

is that the program must be stopped at a breakpo<strong>in</strong>t for the Evaluate/<br />

Modify dialog box to function.<br />

If you want to change the value of a variable, enter a new value for the variable <strong>in</strong> the New<br />

Value field and click the Modify button. The variable’s value will be changed to the new value<br />

entered. When you click the Run button to restart the program (or cont<strong>in</strong>ue stepp<strong>in</strong>g), the<br />

new value will be used.<br />

View Call Stack<br />

The Evaluate/Modify dialog box does not update automatically when<br />

you step through your code as do the Watch List and Debug Inspector.<br />

If your code modifies the variable <strong>in</strong> the Evaluate/Modify dialog box,<br />

you must click the Evaluate button aga<strong>in</strong> to see the results. A typical<br />

<strong>in</strong>teraction with this dialog box would be to evaluate a variable or<br />

expression and then immediately close the Evaluate/Modify dialog box.<br />

While your program is runn<strong>in</strong>g, you can view the call stack to <strong>in</strong>spect any functions your<br />

program called. From the ma<strong>in</strong> menu, choose View | Call Stack to display the Call stack<br />

w<strong>in</strong>dow. This w<strong>in</strong>dow displays a list of the functions that were called by your program and<br />

the order <strong>in</strong> which they were called. The most recently called function will be at the top of<br />

the w<strong>in</strong>dow. The functions listed will be a comb<strong>in</strong>ation of functions <strong>in</strong> your program, VCL<br />

methods, and functions conta<strong>in</strong>ed <strong>in</strong> W<strong>in</strong>dows DLLs. Figure 11.9 shows the call stack as it<br />

appears after you run the DebugTst program you created earlier <strong>in</strong> the chapter.<br />

413<br />

11

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

Saved successfully!

Ooh no, something went wrong!