reflect.Method.getReturnType
Returns the type of a return value of a method.
Syntax
getReturnType(
index INTEGER )
RETURNS reflect.Type
- index is the ordinal position of the return value.
Usage
The getReturnType()
method returns a reflect.Type
object representing the type of the return value at the
specified index, for the method 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 "return type 1 = ", met.getReturnType(1).toString()
END FUNCTION
Shows:
return type 1 = SMALLINT