Qore Programming Language Reference Manual: Include Files

Qore Programming Language Reference Manual 0.8.11

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups Pages
Include Files

A Qore program can include other program code to be used and executed in the current program by using the %include directive. The %include directive must be the first text on the line, and the file name to include must follow. All text on the line after the %include directive will be used for the file name to include. The file name should not be quoted.

Here is an example:

#!/usr/bin/qore
%include /usr/qore/lib/functions.ql

After this, any variable, function, namespace, constant, or object declared in the above file can be used by the Qore program.

The `QORE_INCLUDE_DIR` environment variable determines the search path for include files (see Environment Variables).