Additional source code files can be inserted into the current script or template using the syntax '#include "filename"'. For example:
Note that a semi-colon is not required after the statement. The angle brackets '<' and '>' can be used around the file name instead of quotes (as in regular C), but the semantics are the same. The indicated file will be inserted into the script or template and the code will be executed as if it were one long file.
When a file is included, it will be searched for in the following directories in the following order:
- Current Working Directory - If 010 Editor was started from the command line, the current working directory would be the directory where 010 Editor was started from, else the current working directory is usually the directory where 010 Editor was installed ('C:\Program Files\010 Editor\' by default).
- File Directory - The directory where the file that contains the include statement currently resides.
- Template Directory - The default Template directory specified using the Directory Options.
- Script Directory - The default Script directory specified using the Directory Options.
- Template Repository Directory - The directory where Templates from the Repository are installed (see Directory Options).
- Script Repository Directory - The directory where Scripts from the Repository are installed (see Directory Options).
- Additional Include Directories - Any additional directories specified using the Compiling Options dialog.
Include files can be nested as in regular C. Note that during execution, if an error occurs inside an include file, you will be asked if you want to load the include file in the interface.