Runtime Type Information

Runtime Type Information (RTTI) is a language feature that gives a Delphi application the capability to retrieve information about its objects at runtime. RTTI is also the key to links between Delphi components and their incorporation into the Delphi IDE, but it isn't just an academic process that occurs in the shadows of the IDE.

Objects, by virtue of being TObject descendants, contain a pointer to their RTTI and have several built-in methods that enable you to get some useful information out of the RTTI. Table 2.7 lists some of the TObject methods that use RTTI to retrieve information about a particular object instance.

Table 2.7. TObject Methods that Use RTTI
Function Return Type Returns
ClassName() string The name ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.