reflect.Method.getParameterCount

Returns the number of parameters of a method.

Syntax

getParameterCount()
  RETURNS INTEGER

Usage

The getParameterCount() method returns the number of parameters of the method object represented by this reflect.Method object.

The reflect.Method object used to call this method must have been created with the reflect.Type.getMethod() method, from a reflect.Type object created with a RECORD with methods, or and INTERFACE type.

Example

IMPORT reflect
TYPE Customer INTERFACE
        create(id INTEGER, name VARCHAR(30)) RETURNS SMALLINT,
        delete(id INTEGER) RETURNS SMALLINT
    END INTERFACE
FUNCTION main()
    DEFINE typ reflect.Type
    DEFINE met reflect.Method
    DEFINE cus Customer
    LET typ = reflect.Type.typeOf(cus)
    LET met = typ.getMethod(1)
    DISPLAY "param count   = ", met.getParameterCount()
END FUNCTION
Shows:
param count  =           2