Pre-Processor Statements - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

Pre-Processor Statements

Pre-Processor Statements supported by Axcess include the Include File and System_Call
Keywords, described below:
Include File and System_Call Keywords
INCLUDE
SYSTEM_CALL
The SYSTEM_CALL keyword
is similar to the CALL key-
word, except that the subrou-
tine resides in a special file
called a library file.
#DEFINE
This keyword is actually a
command to the compiler, not
to the Central Controller. It is
used to define a symbol.
#END_IF
The code inside the two pre-
processor keywords is com-
piled only if the symbol
following the #IF_DEFINED is
defined.
#IF_DEFINED
This keyword is used to
achieve conditional compila-
tion.
#IF_NOT_DEFINED
Axcess Programming Language
When the compiler reaches the INCLUDE statement, it jumps to the specified
file and continues compiling. When it has reached the end of that file, it comes
back to the line following the INCLUDE statement and continues compiling.
The code compiled in the Include file is compiled as if it were in the main pro-
gram, where the INCLUDE statement is located. The INCLUDE statement can
appear anywhere in your program, since it is actually a statement to the com-
piler, not the Axcess control system.
The syntax:
INCLUDE 'DOS filename'
Include files are loaded and edited using the Axcess editor much like normal
program files. Like program files, the Axcess name (not the DOS name) of the
INCLUDE file is stored on the first line of the file in a PROGRAM_NAME decla-
ration. Include files are saved with the DOS extension AXI. For more details,
refer to the next section, Include Files and System_Calls.
When this keyword is used, the compiler generates a CALL to the subroutine in
the library file and automatically includes the library file for compilation. The
library file is actually compiled after the main program file is compiled.
_ _Date_ _
At compile time, this keyword is replaced by a string (MM/DD/YY) that contains
the compile time date. For example:
(* The program was compiled on May 24, 1998 *)
SEND_STRING Ø, _ _DATE_ _
The string 'Ø5/24/98' is sent to device Ø.
Here is the format:
#DEFINE symbol name
The symbol can be any identifier that is not already used elsewhere in the pro-
gram. When the symbol is defined using #DEFINE, it can only be referred to by
one of the other preprocessor keywords, such as #IF_DEFINED and
#IF_NOT_DEFINED.
A symbol is considered defined if it meets one of the following conditions:
• It has been defined as a variable in the DEFINE_VARIABLE definition section
• It has been defined as a constant in the DEFINE_CONSTANT definition
section
• It has been defined as a device in the DEFINE_DEVICE definition section
• It is a name of a DEFINE_CALL subroutine
• It has been defined using #DEFINE
The syntax:
#IF_DEFINED symbol
(* Statement *)
This is essentially the same as #IF_DEFINED, except the code enclosed by the
#IF_NOT_DEFINED and the #END_IF will be compiled only if the symbol is not
defined.
Pre-Processor Statements
101

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Axcess

Table of Contents