Download HP Pascal for OpenVMS Language Reference Manual
Transcript
%IF Config = Config1
%THEN
{ Code for Config1... }
%ELIF Config = Config2
%THEN
{ Code for Config2... }
%ELSE Config = Config3
{ Code for Config3...}
%ENDIF
Note that the compile-time expression for the %IF statement is the same
compile-time expression that can be used anywhere in HP Pascal. You can
use any operator or builtin routine in a %IF control expression, as you can in
any constant expression.
One use of %IF is to compile for various configurations or environments (as
shown in the preceding example).
Rather than defining a constant in the Pascal source as shown in the examples
here, you might want to define the constant from the command line with the
/CONSTANT qualifier. See the description of the /CONSTANT qualifier for
more information.
11.5 %DEFINED
%DEFINED takes a name and returns TRUE if a name has a meaning in the
current scope; otherwise, it returns FALSE. This is shown in the following
example:
%IF %DEFINED(X)
%THEN
writeln(x);
%ENDIF
11.6 %ERROR, %WARN, %INFO, and %MESSAGE
These directives will accept one or more string expressions, and at compile
time will produce an error message, warning message, informational message,
or terminal-only output (respectively).
The syntax is as follows:
%ERROR
%WARN
%INFO
%MESSAGE
11–8 Directives
( string-expression, . . . )
( string-expression, . . . )
( string-expression, . . . )
( string-expression, . . . )
Related documents
Language Reference Manual
HP Pascal for OpenVMS User Manual
User Manual for OpenVMS Systems
ASTER Reference Guide - ASTER SCIENCE PROJECT
Prac1 - Monash University
Laser Traffic Control System User Manual
HP Pascal Software Product Description
Manual(131122)
8 Gigabit Web Smart Switch User`s Manual
User Manual - Netwerk producten