MethodList Function | |
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
public static Array MethodList(
Object oClass
)
Request Example
View SourceParameters
- 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.
1FUNCTION Start()
2 LOCAL oPerson AS Person
3 oPerson := Person{"Susan", 5, "Cue")
4 AEval(MethodList(oPerson),{|x| QOut(x)})
5
6
7
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