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.lib
After this, any variable, subroutine, 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.