Compiler directives – HP SunSoft Pascal 4.0 User Manual

Page 270

Advertising
background image

246

Pascal 4.0 User’s Guide

A

A defined conditional variable is enabled (

true

) when it appears in either the

%enable

directive or in the

–config

option; otherwise, it is disabled (

false

),

as in:

The following section describes

%var

and

%enable

. Programs that contain

conditional variables must be compiled with the

–xl

option.

Compiler Directives

A directive indicates some action for the compiler to take. You can use a
directive anywhere in your program.

Each directive consists of a percent sign (

%

) followed by the directive name.

Programs that contain compiler directives must be compiled with the

–xl

option.

Table A-1 summarizes the compiler directives.

%var one two

%enable two

Table A-1

cppas

Compiler Directives

Compiler
Directive

Description

%config

Sets a special predefined conditional variable with a value of either

true

or

false

.

%debug

Instructs

pc

to compile this line of code when you use the

-cond

compiler directive.

%else

If expression in

%if

expression

%then

is

false

, the compiler skips over

the

%then

part and executes the

%else

part instead.

%elseif

If expression in

%if

expression

%then

is

false

, the compiler skips over

the

%then

part and executes the

%elseif

part instead. Similar to

%els

e.

%elseifdef

If expression in

%ifdef

expression

%then

is false, the compiler skips over

the

%then

part and executes the

%elseifdef

part instead.

%enable

Sets a conditional variable to

true

.

%endif

Indicates the end of an

%if

or

%ifdef

directive.

%error

Prints a string on the standard output and treats it as an error.

Advertising