IPythonClassObject.Invoke

Syntax

Invoke(FunctionName: String; Params: Array): Variant;

Parameters

FunctionName. Name of executed function. Parameter value is case sensitive.

Params. Array of parameter values sent to function.

Description

The Invoke method executes the class function and returns result of its work.

Comments

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 any Python class, list, or tuple as an input parameter, create the corresponding object using one of the Fore classes: 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.

Example

The example of use is given in description of the IPythonClassObject.GetAttr method.

See also:

IPythonClassObject