ClassTree Function |
Namespace: XSharp.RT
FUNCTION ClassTree( oObject AS Object ) AS ARRAY
public static Array ClassTree( Object oObject )
1CLASS Person 2 EXPORT name, sign 3CONSTRUCTOR(tName, tSign) 4 name := tName 5 sign := tSign 6END CLASS 7CLASS Male INHERIT Person 8 EXPORT prefers 9END CLASS 10CLASS OldMale INHERIT Male 11 EXPORT age 12END CLASS 13FUNCTION InheritanceTree() 14 LOCAL y AS OBJECT 15 LOCAL a AS ARRAY 16 y := OldMale{"Charlie", "dude"} 17 a := ClassTree(y) 18 ? ArrayGet(a, 1) // OLDMALE 19 ? ArrayGet(a, 2) // MALE 20 ? ArrayGet(a, 3) // PERSON