Load external routine

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

Syntax

Load external routine routine-name or library-name/routine-name (parameters)

Description

This command loads the specified external code into memory. You can enter the routine name as the parameter. If the library/resource is not in the EXTERNAL folder, the name of the file containing the library/resource and the library/resource name within that file are given as parameters.

If the library/resource is already loaded or is not found, the flag is cleared and no action is taken. If this command is included in a reversible block, the library/resource is unloaded when the method terminates. If the library/resource is loaded in, it is called with the mode set at ext_load.

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 (LVAR1,LVAR2), the external can directly alter the field value. Enclosing the field in brackets, for example, Call external routine Maths1 ((LVAR1),(LVAR2)), 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

Load external routine MathsLib/sqr (iNumber,iNumber2)