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.

410 Day 11<br />

NOTE<br />

NOTE<br />

4. From the ma<strong>in</strong> menu, choose Run | Inspect. The Inspect dialog box is displayed.<br />

5. Type this <strong>in</strong> the Expression field and click OK.<br />

6. The Debug Inspector is displayed.<br />

You can only <strong>in</strong>spect this from with<strong>in</strong> a class member function. If you<br />

happen to set a breakpo<strong>in</strong>t <strong>in</strong> a regular function and then attempt to<br />

<strong>in</strong>spect this, you will get an error stat<strong>in</strong>g that this is an <strong>in</strong>valid<br />

symbol.<br />

As you can see, when you’re <strong>in</strong>spect<strong>in</strong>g classes the Debug Inspector w<strong>in</strong>dow conta<strong>in</strong>s three<br />

pages. The Data page shows all the data members for the class. The list of data members is<br />

hierarchical. The first items listed are the data items that belong to the immediate class. The<br />

next group of items listed is the data members of that class’s immediate ancestor class—<strong>in</strong><br />

this case, TForm. If you scroll down through the Debug Inspector list, you will see that<br />

follow<strong>in</strong>g the TForm data members are the data members for the TScroll<strong>in</strong>gW<strong>in</strong>Control class<br />

(TForm’s immediate ancestor) and on and on.<br />

By us<strong>in</strong>g the arrow keys to move up and down through the list of data members, you can tell<br />

at a glance what each data member’s type is (look at the status bar). To further <strong>in</strong>spect a data<br />

member, double-click on the value column on the l<strong>in</strong>e show<strong>in</strong>g the data member. A second<br />

Debug Inspector w<strong>in</strong>dow is opened with the selected data member displayed. You can have<br />

multiple Debug Inspector w<strong>in</strong>dows open simultaneously.<br />

The Debug Inspector has a lot of <strong>in</strong>formation to load, so scroll<strong>in</strong>g<br />

down through the list of items can be slow on some systems.<br />

The Methods page of the Debug Inspector displays the class’s methods. As with the data<br />

members discussed earlier, the list of methods is hierarchical. The first methods are those <strong>in</strong><br />

the immediate class, followed by the methods <strong>in</strong> the ancestor classes. In some cases the<br />

Methods tab is not displayed (when <strong>in</strong>spect<strong>in</strong>g simple data types, for <strong>in</strong>stance).<br />

The Properties page of the Debug Inspector shows the properties for the class be<strong>in</strong>g<br />

<strong>in</strong>spected. Inspect<strong>in</strong>g properties through the Debug Inspector is very slow if you<br />

are <strong>in</strong>spect<strong>in</strong>g a VCL <strong>in</strong>herited class. Most of the time you can accomplish the same th<strong>in</strong>g<br />

by <strong>in</strong>spect<strong>in</strong>g the data member associated with a particular property on the Data page <strong>in</strong>stead.<br />

Inspect<strong>in</strong>g the data member is much faster than <strong>in</strong>spect<strong>in</strong>g properties.

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

Saved successfully!

Ooh no, something went wrong!