Click or drag to resize

ClassTreeClass Function

X#
Get the class hierarchy of a class.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ClassTreeClass(
	symClass AS STRING
) AS ARRAY
Request Example 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#
 1CLASS Person
 2    EXPORT name, sign
 3CONSTRUCTOR(tName, tSign)
 4    name := tName
 5    sign := tSign
 6END CLASS
 7
 8CLASS Male INHERIT Person
 9    EXPORT prefers
10END CLASS
11CLASS OldMale INHERIT Male
12    EXPORT age
13END CLASS
14FUNCTION InheritanceTree()
15    LOCAL a AS ARRAY
X#
1a := ClassTreeClass(#OldMale)
2? ArrayGet(a, 1)            // OLDMALE
3? ArrayGet(a, 2)            // MALE
4? ArrayGet(a, 3)            // PERSON
See Also