A

The Pascal program, if_then_else.p

Example

program if_then_else (output); %var red

begin

%if red %then

writeln ('It is red.'); %else

writeln ('It is not red.') %endif

end.

The output when you compile if_then_else.p without the -config

The output when you supply -configwith the argument red

hostname% pc -xl if_then_else.p hostname% a.out

It is not red.

hostname% pc -xl -config red if_then_else.p hostname% a.out

It is red.

The %elseif Directive

The %elseif directive provides an alternative action to the %if directive.

Syntax

%if expression %then

.

.

%elseif expression %then

.

.

%endif

Pascal Preprocessor

251