Click or drag to resize

MParamCount Function

Return the number of arguments that a method is expecting.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION MParamCount(
	symClass AS STRING,
	symMethod AS STRING
) AS DWORD
View Source

Parameters

symClass
Type: String
The symbol of the class containing the method to examine.
symMethod
Type: String
The method name, specified without parentheses.

Return Value

Type: UInt32
Remarks
Examples
This example uses MParamCount() to get the number of arguments that the Area method in class Rectangle is expecting.  Furthermore, the example sets up a Geometry class with an IdentifyObject() method that uses MParamCount() to collect information about different objects:
X#
CLASS Rectangle
METHOD Area(x, y) CLASS Rectangle
RETURN x*y
CLASS Geometry
METHOD IdentifyObject(symObject, symMethod);
        CLASS Geometry
RETURN MParamCount(symObject, symMethod)
Function Start()
        LOCAL oShapes AS OBJECT
        ? MParamCount(#Rectangle, #Area)                // 2
        oShapes := Geometry{}
        ? "It is a "+NTrim(oShapes:IdentifyObject;
                (#Rectangle, #Area))+ " dimensional object"
        // It is a 2 dimensional object
        RETURN TRUE
See Also