Originale-mail to me for new edition

 

Class operators

 

Every class inherits from TObject methods called ClassType and ClassParent that return, respectively, a reference to the class of an object and of an object’s immediate ancestor. Both methods return a value of type TClass (where TClass = class of TObject), which can be cast to a more specific type. Every class also inherits a method called InheritsFrom that tests whether the object where it is called descends from a specified class. These methods are used by the is and as operators, and it is seldom necessary to call them directly.

The is operator

The as operator

 

Topic groups

 

See also

Class operators

Class references: Overview

 

 

译文

 

类运算符

 

每个类都继承了TObject中的ClasstypeClassParent方法,分别是对象所属的类、对象的直接祖先所属的类的引用。两个方法都返回TClassTClass = class of TObject)类型,它可以被转换成为更精确的类型。每个类还继承了一个叫做InheritsFrom的方法,该方法用于测试对象是否起源于指定的类。这些方法都用于is运算符和as运算符,并且很少有必要直接调用这些方法。

 

is运算符

as运算符

 

主题组

 

相关主题

类运算符(语法元素)

类引用:概述