Click or drag to resize

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.10
Syntax
 FUNCTION MethodList(
	oClass AS Object
) AS ARRAY
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#
FUNCTION Start()
        LOCAL oPerson AS Person
        oPerson := Person{"Susan", 5, "Cue")
        AEval(MethodList(oPerson),{|x| QOut(x)})
        // Result is:
        // INIT
        // SHOWGRADE
CLASS Person
        EXPORT name
        INSTANCE grade
        PROTECT password
METHOD Init(tname, tgrade, tpassword) CLASS Person
        name := tname
        grade := tgrade
        password := tpassword
METHOD ShowGrade() CLASS Person
        ? grade
ACCESS Grade() CLASS Person
        RETURN grade
See Also