ZBasic Language Reference
76
ZX Microcontroller Family
Const Frequency As Single = 45.347
#else
#error No platform specified.
#endif
3.12 Notice Directive
This directive is similar to the #error directive discussed in the previous section in that it adds a string to
the error output. However, its used does not increase the error count like #error does.
The form of the error directive is shown below.
#notice <message>
3.13 Include Directive
You may use an include directive in a source file to cause another source file to be compiled as well. The
form of the include directive is:
#include "<filename>"
The <filename> element is the name of the file that you want to have compiled. If the filename is not
specified using an absolute path (i.e. beginning with the root directory and/or a drive letter), the path
prefix (if any) of the current module will be appended to the front of the filename. Note, however, that if
an include path is specified on the command line, a filename specified with a relative path will, instead, be
sought in among the directories specified in the include path list. See Section 8.2 for more information on
the include path option.
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.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.10, 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 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.9.