External Functions

external function calls

to invoke an exernal compiled function it is only necessary to nominate the library in which it exists and to declare the name of the function as a function

The library statement causes XPE to link to an external dynamic link library

e.g.
library "mylib.dll"
(the file name does not need to have a specific extension in order to be valid)

To use the external function 'fred' simply define it (once is enough)

e.g.
define proc fred
then use it like an internal function
e.g.
a = fred(x, y) + 2

you must be aware of the functions usage protocol, supplying needed parameters and using the returned result properly. XPE does not check the actual paramter list against a formal paramter list at compile time (maybe it will in the future) but will instead trap invalid parameter and result usage at runtime.

The XPE interface allows functions to easily process variable numbers of arguments. It is the responsibility of the called function to cope with the number supplied.

external function interface