| IncludeStatement | Pragma weak/strong | Pragma cast |
With the include preprocessor statement other
.csf files can
be included into another script file.
: '#' 'include' StringLiteral
To include other files use the include can be used
MyOtherModule.csf is a normal CfgScript file.
The include statment protects for multiple/recursive includes.
#ifdef guards, you have to use in C/C++ are not needed.
The include statements search in following file:
Please refer also to the command line option -csfinclude / CSFINCLUDES.
- The directory of the current csf file
- The Current working directory
- The pathes in the
CSFINCLUDES Environment variable
Alternativelly also can also be used:
See also: acdk::cfgscript::Script.
bool noDups = true;
bool changeToDir = false;
interpreter.include("MyOtherModule.csf", noDups, changeToDir);
If you want to create CfgScript modules with classes, you can load the CfgScript
Please refer to CfgScript ClassLoader for more information.
// will use the classloader to find and load the script
mytest.MyOtherScript o = new mytest.MyOtherScript();
include statement works like a C/C++ include statement.
This has consequence, that global variables defined in the included
script file is also visible in the script file, which includes the file.
Module variables in scripts, which are loaded via the ClassLoader are not
visible outside the module.