Compiler directives
Compiler directives are special kinds of comments, that give instructions to the compiler, and look like this:
OPEN_COMMENT $ NAME INFORMATION CLOSE_COMMENT
where OPEN_COMMENT is either
{ or (*
and CLOSE_COMMENT is either
} or *)
and NAME is the name of the compiler directive and is on of the following:
- B - A flag directive that controls short-circuit evaluation. See
Order of evaluation of operands of dyadic operators for more
information about short-circuit evaluation. See also the -sc compiler option for the command-line
compiler for more information (documented in the User's Manual).
- I - Both a flag directive that controls run-time I/O checking, and a value directive
that specifies the name of a file to include. See
traperrors procedure for more information.
- P - A flag directive that controls mandatory parenthesis mode. See the -p compiler option
for the command-line compiler for more information (documented in the User's Manual).
- R - A flag directive that controls range checking. See the -r compiler option
for the command-line compiler for more information (documented in the User's Manual).
- S - A flag directive that controls strict checking of string parameters passed by reference.
See the -s compiler option for the command-line compiler for more information (documented in the User's Manual).
- U - A flag directive that controls checking for accessing undefined values.
See the -u compiler option for the command-line compiler for more information (documented in the User's Manual).
- V - A flag directive that controls checking for accessing inactive record variants. See
record types for more information on record variants. See also the -v compiler
option for the command-line compiler for more information (documented in the User's Manual).
- W - A flag directive that controls whether the compiler issues warnings or not.
All of the compiler directive can be used as flag directives, and in this case the compiler directive instructs the
compiler to turn an option on or off. When a compiler directive is used as a flag directive the INFORMATION
part of the compiler directive is one of the following symbols:
- + : Turns the compiler option on.
- - : Turns the compiler option off
- . : Returns the compiler option to its previous setting before the last change. The compiler displays
an error if there is no previous setting for the compiler option.
So for example the following compiler directive (*$R-*) turns range checking off.
The I compiler directive can be used to instruct the compiler to include a file inside the current file.
In this case the INFORMATION part of the compiler directive is the name of the file to include.
For example: (*$I windows.inc*)
The W compiler directive can be used to instruct the compiler to turn off or on individual warning messages.
So for example:
(*$W44-*)
can be used to turn off the warning about "<X> is never used", before including a file which declares many identitifiers (some
of which you don't intend to use) and
(*$W44+*)
can be used to turn this warning back on after the file is included.