![]() ZBasic Language Reference
76
ZBasic Microcontrollers
the #include in the source code, a filename specified with a relative path will, instead, be sought among
the directories specified in the include path list. See Section 10.2 for more information on the --
include-path option. See the next section for information about the #include_path directive.
Note that the effect of the include directive is no different than if you had instructed the compiler directly to
compile the file. It is compiled as a separate module.
BasicX Compatibility Note
Include directives are not supported in BasicX compatibility mode.
3.13 Include_path Directive
You may specify a list of directories in which to searh for files to be included via #include in the cases
where the filename is not absolute. The include path is also used when importing definitions from
external C/C++ header files using the #import directive (see section 6.8). The include path directive has
the following form.
#include_path "<directory_list>"
Note that this directive may be used as many times as needed but the path list specified most recently
preceding a particular #include or #import directive will be the one in effect for that operation.
Whitespace preceding and following directory names in the path list is ignored and the entire semicolon-
separated list must be enclosed in double quotes. Further, either forward slash or backslash may be
used as directory separators within the pathnames. If a component of the directory list ends with a slash
(or backslash) followed by an at sign (@), that directory and all subordinate directories will be added to
the include path.
Examples
#include_path "C:\arduino-0022\hardware\arduino\cores\arduino"
#include_path "C:\My Projects/subdir; C:/mydir2;D:/subdir/dir3"
3.14 Using Conditional Directives in Project and Argument Files
The ZBasic compiler optionally supports the use of the conditional directives, as described in Section 3.9,
in project and argument files. Because conditionals are introduced with a # character and that same
character is recognized as a comment introduction character in project and argument files, support for
conditionals in these files is not enabled by default.
You may enable support for conditionals in project and argument files using the compiler option --
allow-conditionals. If this option appears as the first line in a project or argument file, conditionals
will be enabled for that file and for all subsequently processed project and argument files. If the --
allow-conditionals option appears on a line other than the first line, conditionals will be enabled for
subsequently processed files but not for the file in which the option appeared. Alternately, conditionals
may be enbled only for a specific project or argument file by placing the special comment #!allow-
conditionals as the first line of the file.
When creating conditionals in project and argument files, you may utilize symbols previously defined via
command line options as well as the built-in constant symbols described in Section 3.8.
|