Description |
General
The external module is included at that position of the programm text where the USES statement stands.
Restrictions
At the moment (Version 6.2.6) the following restrictions are valid:
The external module has to be there in source code.
Only one module per USES line can be included.
So not
USES a.mod, b.mod, c.mod;
but
USES a.mod;
USES b.mod;
USES c.mod;
Functioning
A library module is principally included only once, also if appears in more than one USES statement (e.g. in an included module).
With USES all global identifiers of the module are imported, so
* all global variables
* all procedures and functions
If there are more than one identifiers of the same name that one of the last inluded module is valid. To define an identifier xyz from a module abc.mod unique the module name can be prefixed: abc.xyz
All standard identifier are automatically imported from the module system.mod. That is why the module name "system" can be prefixed to standard identifiers if e.g. standard procedures are redefined.
Example:
PROCEDURE LoadTemplate(path : STRING) : INTEGER;
VAR result : INTEGER;
system.LoadTemplate(path);
WHILE subst('#action#',ParamStr(0)) DO END
RETURN result
ENDPROC
Search path
If no complete path is specified, the following search order is valid:
* actual directory
* directory of the including programm
* directory of the pathes that are defined in the configuration file tdbengine.ini in the section [globals] under "libpath".
|