71
BasicX Compatibility Note
Conditional constructs are not supported in BasicX compatibility mode.
3.13 Error Directive
Sometimes it is useful to be able to purposely generate an error message in order to remind yourself of
some detail or condition that requires attention. Often, this is used in conjunction with conditional
directives to point out that an incompatible set of conditions exists.
The form of the error directive is shown below.
#error <message>
All of the characters beginning with the first non-white space character following #error up to the end-of-
line will appear as the error message. If the last character on the line is an underscore and is preceded
by a space or tab character, it is treated as a continued line and all of the characters on the next line up to
the end-of-line will also be part of the error message.
Example
#if PLATFORM = "alpha"
Const Frequency As Single = 42.347
#elseif PLATFORM = "beta"
Const Frequency As Single = 45.347
#else
#error No platform specified.
#endif
3.14 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.15 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 7.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.