Keywords & Run-Time Library Functions; File; Ldate; Line - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Reserved Identifiers
Compiler Directives (Cont.)

#INCLUDE

#WARN

Keywords & Run-Time Library Functions
The keywords and run-time library function supported by NetLinx are described in the table below.
Keywords & Run-Time Library Functions
__DATE__

__FILE__

__LDATE__

__LINE__

__NAME__

__TIME__

ABS_VALUE

ACTIVE

100
To include a file in a program, use the keyword #INCLUDE followed by the file-
name in single quotes.
DEFINE_PROGRAM
(* Program statements can go here *)
#INCLUDE 'TEST.AXI'
(* More program statements can go here *)
When the compiler reaches the #INCLUDE statement, it jumps into the speci-
fied 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 com-
piling.
This compiler directive displays a warning message after the program is com-
piled. Its primary purpose is to remind you of certain conditions related to the
program.
#WARN 'This code is obsolete'
#WARN 'This code is obsolete'
__DATE__ is replaced by a string (mm/dd/yy) containing the date of compila-
tion. The example below sends the date of compilation to a variable text button
on a touch panel.
SEND_COMMAND TP, "'!T',1,__DATE__"
At compile time, this keyword is replaced with a string that contains the filename
of the currently executing program file.
At compile time, this keyword is replaced by a string (mm/dd/yyyy), containing
the date of compilation. The example below sends the date of compilation to a
variable text button on a touch panel.
SEND_COMMAND TP, "'!T',1,__LDATE__"
At compile time, this keyword is replaced by a constant that contains the line
number the keyword is on.
SEND_STRING 0,"ITOA(__LINE__)"
At compile time, this keyword is replaced by a string that contains the
PROGRAM_NAME description found on the first line of the program.
At compile time, this keyword is replaced by a string (hh:mm:ss) representing
the time of compilation. The example below sends the time of compilation to a
variable text button on a touch panel.
SEND_COMMAND TP, "'!T',1,__TIME__"
ABS_VALUE provides the absolute value of a variable. It will take any intrinsic
variable type and return the same type.
AbsVal ABS_VALUE (Value)
DEFINE_VARIABLE
SLONG Var1, Var2
DEFINE_START
Var1 = -1
DEFINE_PROGRAM
Var2 = ABS_VALUE(Var1)
See SELECT...ACTIVE on page 148.
NetLinx Programming Language Reference Guide
// Var2 = 1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents