Call external routine

Command group Flag affected Reversible Execute on client Platform(s)
Externals NO NO NO All

Syntax

Call external routine routine-name or library-name/routine-name (parameters) Returns return-value

Description

This command calls an external routine with mode ext_call and returns a value from the external in the specified return-field. The return value is placed in the specified field by the external code using the predefined field reference Ref_returnval with the functions SetFldVal or SetFldNval. The flag is set if the external routine is found and the call is made but this does not necessarily mean that the external code has executed correctly. The flag is cleared if the routine is not found. Note that the routine cannot use the flag to pass information back to the method.

You can pass parameters to the external code by enclosing a comma-separated list of fields and calculations. If you pass a field name, for example, Call external routine Maths1 (Num1,Num2), the external can directly alter the field value. Enclosing the field in brackets, for example, Call external routine Maths1 ((Num1),(Num2)), converts the field to a value and protects the field from alteration.

In the routine itself, the parameters are read using the usual GetFldVal or GetFldNval with the predefined references Ref_parm1, Ref_parm2, and so on, Ref_parmcnt gives the number of parameters passed. If the field name is passed as a parameter, you can use SetFldVal or SetFldNval with Ref_parm1, and so on, to change the field's value.

Example

Call external routine MathsLib/sqroot (iNumber) Returns iNumber2