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.

NOTE<br />

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

The Methods page and the Properties page of the Debug Inspector are<br />

only available when you’re <strong>in</strong>spect<strong>in</strong>g a class. When you’re <strong>in</strong>spect<strong>in</strong>g<br />

simple data types, only the Data page will be displayed.<br />

The Debug Inspector speed menu has several items that allow you to work with the Debug<br />

Inspector and the <strong>in</strong>dividual variables. For example, <strong>in</strong>stead of open<strong>in</strong>g a new Debug<br />

Inspector w<strong>in</strong>dow for each object, you can choose Descend from the speed menu to replace<br />

the current object <strong>in</strong> the Debug Inspector w<strong>in</strong>dow with the object under the cursor. This<br />

method has an added advantage: The IDE will keep a history list of the objects you <strong>in</strong>spect.<br />

To go back to an object you have previously <strong>in</strong>spected, just choose the object from the combo<br />

box at the top of the Debug Inspector w<strong>in</strong>dow. Choos<strong>in</strong>g one of the objects <strong>in</strong> the history<br />

list will aga<strong>in</strong> show that object <strong>in</strong> the Debug Inspector w<strong>in</strong>dow.<br />

The Change item on the Debug Inspector speed menu will allow you to change the value of<br />

a variable. Change data members with care. Chang<strong>in</strong>g the wrong data member or specify<strong>in</strong>g<br />

a value that is <strong>in</strong>valid for that data member could lead to your program crash<strong>in</strong>g. The Inspect<br />

item on the speed menu allows you to open a second Debug Inspector w<strong>in</strong>dow with the item<br />

under the cursor displayed. The New Expression speed menu item allows you to enter a new<br />

expression to <strong>in</strong>spect <strong>in</strong> the Debug Inspector.<br />

The Show Inherited item on the Debug Inspector speed menu is a toggle that determ<strong>in</strong>es how<br />

much <strong>in</strong>formation the Debug Inspector should display. When the Show Inherited option is<br />

on, the Debug Inspector shows all data members, methods, and properties of the class be<strong>in</strong>g<br />

<strong>in</strong>spected as well as the data members, methods, and properties of all ancestor classes. When<br />

the Show Inherited option is off, only the data members, methods, and properties of the class<br />

itself are shown. Turn<strong>in</strong>g off this option can greatly speed up the Debug Inspector s<strong>in</strong>ce it<br />

does not have as much <strong>in</strong>formation to display.<br />

TIP<br />

If you have a class data member and you don’t remember that data<br />

member’s type, you can click on it when stopped at a breakpo<strong>in</strong>t and<br />

press Alt+F5 to display the Debug Inspector. The status bar at the<br />

bottom of the Debug Inspector w<strong>in</strong>dow will tell you the data type of<br />

the variable. This also works for W<strong>in</strong>dows and system #def<strong>in</strong>es such as<br />

HINSTANCE, HWND, DWORD, and so on.<br />

411<br />

11

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

Saved successfully!

Ooh no, something went wrong!