Invoke( ) method (Class)
- Last Updated: January 18, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Dynamically invokes a method whose name and parameters must be set at run time. The Invoke( ) method is one of several reflection methods of the Progress.Lang.Class class that provide type information about a class or interface at run time.
Return type: Any data type
Access: PUBLIC
Applies to: Progress.Lang.Class class
Syntax
Four overloaded versions are supported. The first version is used to invoke a method that does not take any parameters.
|
The second overloaded version is used to invoke a method that takes zero or more parameters. Since parameterlist-object can be built with zero or more parameters, this version of the Invoke( ) method can be used to invoke any method, even those that do not take any arguments.
|
The third overloaded version is used when invoking a static method that does not take any parameters.
|
The fourth overloaded version is used when invoking a static method that takes zero or more parameters. Since parameterlist-object can be built with zero or more parameters, this version of the Invoke( ) method can be used to invoke any static method, even those that do not take any arguments.
|
- return-value
- An optional data element which is assigned the return value from the invoked, non-void method. The AVM checks return-value at run time for data type compatibility with what is actually returned by the method.
- class-reference
- An object reference to the Progress.Lang.Class class instance containing the type information.
- object-reference
- A reference to the object that contains the method you want
to invoke, and whose type is compatible with the class-reference object.
When invoking a static method, the Unknown value (
?) is passed for this parameter. - method-name
- A CHARACTER expression that evaluates at run time to the name of the method to be invoked.
- parameterlist-object
- An instance of the Progress.Lang.ParameterList class.
See also
DYNAMIC-INVOKE function, DYNAMIC-NEW statement, New( ) method, NumParameters property (ParameterList), Progress.Lang.ParameterList class, SetParameter( ) method (Class)