Click or drag to resize

ClassTreeClass Function

Get the class hierarchy of a class.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION ClassTreeClass(
	symClass AS STRING
) AS ARRAY
View Source

Parameters

symClass
Type: String
A symbol representing the class name whose class hierarchy you want to get.

Return Value

Type: Array
An array of class names from which <oObject> has been derived.  The last element of the array contains the root class from which subsequent classes in the array inherit.
Remarks
ClassTreeClass() shows what other classes, if any, the specified class inherits from.
Examples
These examples illustrate ClassTreeClass() with multiple inheritances:
X#
CLASS Person
        EXPORT name, sign
METHOD Init(tName, tSign) CLASS Person
        name := tName
        sign := tSign
CLASS Male INHERIT Person
        EXPORT prefers
CLASS OldMale INHERIT Male
        EXPORT age
FUNCTION InheritanceTree()
        LOCAL a AS ARRAY
X#
a := ClassTreeClass(#OldMale)
? ArrayGet(a, 1)                        // OLDMALE
? ArrayGet(a, 2)                        // MALE
? ArrayGet(a, 3)                        // PERSON
See Also