IMPORT

resulttype funcname ( parameterlist ) := IMPORT( language, function [:TIME [(label)] ]);

resulttypeThe ECL return value type of the function.
funcname

The ECL definition name of the function.

parameterlistA comma separated list of the parameters to pass to the function.
languageSpecifies the name of the external programming language whose code you wish to embed in your ECL. A language support module for that language must have been installed in your plugins directory. Modules are provided for languages such as Java, R, Javascript, and Python. You can write your own pluggable language support module for any language not already supported by using the supplied ones as examples or starting points.
functionA string constant containing the name of the function to include.
TIMETracks timing of an external function call or embedded source code and reports them back as metrics to the user.
labelOptional. A string constant containing the name to associate with the timer. If omitted, the default is used.

The IMPORT declaration allows you to call existing code written in the external language. This may be used to call Java or Python code, but is not usable with Javascript or R code (use the EMBED structure instead). Java code must be placed in a .java file and compiled using the javac compiler in the usual way. All Java classes used must be thread safe.

WARNING: This feature could create memory corruption and/or security issues, so great care and forethought are advised--consult with Technical Support before using.

Example:

IMPORT JAVA;
INTEGER jadd(INTEGER a, INTEGER b) := IMPORT(java, 'JavaCat.add:(II)I': TIME('MyTime'));
jadd (22,23);

See Also: IMPORT, EMBED Structure