Click or drag to resize

OOPTree Function

X#
Return a multidimensional array of all object-oriented programming symbols that constitute the class.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION OOPTree(
	oObject AS Object
) AS ARRAY
Request Example View Source

Parameters

oObject
Type: Object
The object whose class symbols you want to retrieve.

Return Value

Type: Array
Each class occupies an array consisting of the class name, a subarray of instance variables, and a subarray of methods.
Remarks
OOPTree() retrieves the names of ancestors (super classes), instance data, and methods in the class definition tree.
Examples
This example uses OOPTree():
X#
 1CLASS Thing_1
 2    EXPORT x1
 3CONSTRUCTOR() CLASS Thing_1
 4    x1 := 1
 5METHOD Meth_1() CLASS Thing_1
 6METHOD Meth_1x() CLASS Thing_1
 7CLASS Thing_2 INHERIT Thing_1
 8    EXPORT x2
 9METHOD Meth_2 CLASS Thing_2
10METHOD Meth_2x CLASS Thing_2
11CLASS Thing_3 INHERIT Thing_2
12    EXPORT x3
13METHOD Meth_3 CLASS Thing_3
14METHOD Meth_3x CLASS Thing_3
15Function Start()
16    LOCAL o AS OBJECT, aTree AS ARRAY
17    o := Thing_3{}
18    aTree := OOPTree(o)
The array, aTree, contains the following information:
X#
 1/***************************
 2Thing-1
 3            x1
 4            Meth_1x
 5            Meth_1
 6            Init
 7Thing-2
 8            x2
 9            x1
10            Meth_2x
11            Meth_2
12            Meth_1x
13            Meth_1
14            Init
15Thing-3
16            x2
17            x1
18            x3
19            Meth_3x
20            Meth_3
21            Meth_2x
22            Meth_2
23            Meth_1x
24            Meth_1
25            Init
26***************************/
See Also