Click or drag to resize

MethodList Function

X#
Create a class list in the form of an array for the specified object.

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

Parameters

oClass
Type: Object
The object whose methods you want to list.

Return Value

Type: Array
An array of symbols containing the name of all methods defined for symObject.
Remarks
This function creates a list of all methods defined for the specified object.
The resulting method list array does not include ACCESS or ASSIGN methods.
Examples
This example uses MethodList() to store a method list for an object of the Person class, then displays the resulting array. Note how the ACCESS method is ignored.
X#
 1FUNCTION Start()
 2    LOCAL oPerson AS Person
 3    oPerson := Person{"Susan", 5, "Cue")
 4    AEval(MethodList(oPerson),{|x| QOut(x)})
 5    // Result is:
 6    // INIT
 7    // SHOWGRADE
 8CLASS Person
 9    EXPORT name
10    INSTANCE grade
11    PROTECT password
12CONSTRUCTOR(tname, tgrade, tpassword)
13    name := tname
14    grade := tgrade
15    password := tpassword
16METHOD ShowGrade()
17    ? grade
18ACCESS Grade()
19    RETURN grade
20END CLASS
See Also