252
Pascal 4.0 User’s Guide
A
Comments
If the expression in
%if
expression
%then
is
false
,
pc
skips over the
%then
part and executes the
%elseif
part instead. expression consists of a
conditional variable and the optional
boolean
operators,
and
,
or
, and
not
.
See the
%else
listing for examples of expression.
Example
The
%elseifdef
Directive
The
%elseifdef
directive provides an alternative action to the
%ifdef
directive.
The Pascal program,
elseif.p
program elseif_example(output);
{ This program demonstrates the use of the
%if, %then, and %elseif directives. }
%var blue red
begin
%if blue %then
writeln('The color is blue.');
%elseif red %then
writeln('The color is red.');
%endif
end. { elseif_example }
The output when you supply
-config
with the argument
blue
hostname% pc -xl -config blue elseif.p
hostname% a.out
The color is blue.
The output when you supply
-config
with the argument
red
hostname% pc -xl -config red elseif.p
hostname% a.out
The color is red.
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......