Variables - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

NetLinx allows variables to be defined as constants in the
or module, and in the
constants is consistent with C++ programming conventions.

Variables

The role of the
definition is:
[NON_VOLATILE|VOLATILE][CONSTANT][<type>]<variable name> [= <value>]
NetLinx handles variables just like Axcess. NetLinx defaults non-array variables to the integer data types
and defaults array variables to character data type array. The variable must be explicitly declared if using
any other data type.
The
NON_VOLATILE
downloaded or after a system reset.
If you initialize a
time the code is loaded or after a system reset. The variable initializes like it would in the
DEFINE_START
section, the variable only initializes when the system is loaded, and it retains any changed values after
system resets.
Variables can now be defined as constant variables. Since the
allow you to explicitly declare a constant's data type, using the
explicitly declare the data type of a constant, and to define constant values for structures and arrays of
structures.
CONSTANT STR_TV CHAN_5 = {'KXAS', 5}
CONSTANT SINTEGER ABS_ZERO = -273
With Axcess, the
keyword. NetLinx expands the scope of
variables now come in two flavors:
LOCAL_VAR [NON_VOLATILE | VOLATILE] [CONSTANT] [<type>] name [= <value>]STACK_VAR
[<type>] name [= <value>]
NetLinx Programming Language Reference Guide
section of a
LOCAL_VAR
section is enhanced for NetLinx. The structure of a variable
DEFINE_VARIABLE
and
keywords specify what happens to a variable when the program is
VOLATILE
variables (the default) lose their values when the program is downloaded, but
NON_VOLATILE
retain their values when the system resets.
variables lose their values when the system is loaded and after the system resets.
VOLATILE
variable in the
VOLATILE
section. If you initialize a
section allowed you to define local variables with the
DEFINE_CALL
now defines a static (fixed) local variable (the next time a
LOCAL_VAR
called, the last value of the
LOCAL_VAR
This is how Axcess handles variables defined with
definitions strictly to the
LOCAL_VAR
appear within any statement block. This includes (but is not limited to)
,
statements,
DEFINE_EVENT
WHILE
defines a non-static local variable.
STACK_VAR
way as
, and like
LOCAL_VAR
The difference is that the value stored in the variable is initialized to zero whenever the
statement block is called, and the value is destroyed when the statement block is finished. The
structure for
and
LOCAL_VAR
DEFINE_VARIABLE
or a
DEFINE_CALL
DEFINE_FUNCTION
section, the variable initializes every
DEFINE_VARIABLE
variable within the
NON_VOLATILE
DEFINE_CONSTANT
CONSTANT
beyond the
LOCAL_VAR
DEFINE_CALL
will be in memory unless the variable is initialized).
LOCAL_VAR
section.
DEFINE_CALL
statements, etc.
WAIT
STACK_VAR
,
can appear in any statement block.
LOCAL_VAR
STACK_VAR
variables include:
STACK_VAR
NetLinx Programming Overview
section of the program
. Assigning
DEFINE_VARIABLE
section does not
keyword allows you to
LOCAL_VAR
section of code. Local
is
DEFINE_CALL
. NetLinx does not limit
definitions can
LOCAL_VAR
DEFINE_FUNCTION
defines local variables the same
,
11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents