A User Language Program can reuse code in other ULP files through the #include directive. The syntax is
#include "filename"
The file filename is first looked for in the same directory as the current source file (that is the file that contains the #include directive). If it is not found there, it is searched for in the directories contained in the ULP directory path.

The maximum include depth is 10.

Each #include directive is processed only once. This makes sure that there are no multiple definitions of the same variables or functions, which would cause errors.

Portability note

If filename contains a directory path, it is best to always use the forward slash as directory separator (even under Windows!). Windows drive letters should be avoided. This way a User Language Program will run on all platforms.

Index Copyright © 2005 CadSoft Computer GmbH