Invoke(FunctionName: String; Params: Array): Variant;
Invoke(FunctionName: String; paramarray Params: Array of Object): Object;
FunctionName. Name of executed function. The name is case-sensitive.
Params. The array of parameter values that must be sent to the executed function.
The Invoke method executes the class function and returns result of its work.
All functions of the classes in Python have at least one input parameter - self - in the signature. A class instance is sent in this parameter. When executing the function using the Invoke method this class instance is sent automatically that is why it should not be specified in the Params array.
If the executed function does not contain input parameters, do not specify Params. Values of parameters in Params can be sent as a separate array or enumerated via a comma. Simple type values, such as, String, Char, Integer, Double, Decimal, Currency, Boolean (types str, int, float, bool in Python), are sent according to Fore syntax without transformations. The Null value corresponds to the None value in the Python language. If a Python function receives an object of some Python class, list, or tuple as an input parameter, create the corresponding object using the Fore class: PythonClassObject, PythonList, PythonTuple.
If the function has parameters with default values, and it is required to send only part of parameters, use named parameters. Named parameters are implemented by the PythonParameter class. Create parameters with required names, set value for them and send them to the Invoke method.
The example of use is given in description of the IPythonClassObject.GetAttr method.
See also: