Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

DECPASS

Comet sets the DECPASS and EXEPASS system symbolic constants as follows:

During the Internet Basic compiler's declarative pass
Symbolic constant Value
DECPASS 1
EXEPASS 0

During the Internet Basic compiler's executable pass
Symbolic constant Value
DECPASS 0
EXEPASS 1

In other words, while Internet Basic is compiling statements in the declarative section of the program, these values are set one way, and when Internet Basic is compiling statements in the executable section of the program, these values are set another way.

(We realize that it's semantically impossible to have "variable constants," but we still think that "symbolic constant" is the best way to describe these terms.)

The most obvious application of these symbolic constants involves conditional compilation of statements in a usefile. By using the .IF and .ENDIF directives in combination with DECPASS and EXEPASS, you can include both declarative and executable code in a single usefile. Here's a code outline that shows how this works:

.IF DECPASS
(declarative statements)
.ENDIF

.IF EXEPASS
(executable statements)
.ENDIF
During the compiler's declarative pass, the .IF DECPASS directive is evaluated as true (because DECASS equals 1). During this pass, the .IF EXEPASS directive is evaluated as false (because EXEPASS equals 0). Result: During this pass, the declarative statements are compiled, but the executable ones are not.

However, during the executable pass, things are reversed. The .IF DECPASS directive becomes false, and the .IF EXEPASS directive becomes true. Result: During this pass, the executable statements are compiled, but the declarative ones are not.