System.TObject.ClassParent

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

class function ClassParent: TClass;

C++

__classmethod TClass __fastcall ClassParent();

Properties

Type Visibility Source Unit Parent
function public
System.pas
systobj.h
System TObject

Description

Returns the type of the immediate ancestor of a class.

ClassParent returns the name of the parent class for an object instance or class reference. For TObject, ClassParent returns nil (Object Pascal) or NULL (C++).

Avoid using ClassParent in application code.

Note: In Object Pascal code, use the is or as operators instead of ClassParent.

Note: In C++ code, use a dynamic cast or the InheritsFrom method instead of ClassParent.

See Also

Code Examples