AMX NETLINX PROGRAMMING LANGUAGE Manual page 62

Programming language
Table of Contents

Advertisement

Language Elements
DEFINE_CALL 'My Subroutine' (INTEGER INT1)
DEFINE_CALL 'My Subroutine' (INTEGER INT1)
The scope of a local variable is restricted to the statement block in which it is declared. A local variable
is either static or non-static, depending on whether it is declared as
A static variable maintains its value throughout the execution of the program,
regardless of whether it is within scope of the current program instruction.
IF (X > 10)
{
}
Variable declarations outside of DEFINE_VARIABLE will default to STACK_VAR if
neither "local" or "stack" is specified.
LOCAL_VAR
Only
LOCAL_VAR
WAIT 10, 'My Wait Name'
{
}
A name assigned to a local variable must be unique within the statement block in which it is declared and
any statement block enclosing that block. Therefore, non-nested statement blocks can define the same
local variable name without conflict. For example:
46
LOCAL_VAR INTEGER INT2
{
(* body of subroutine *)
}
{
LOCAL_VAR INTEGER INT2
(* body of subroutine *)
}
The keyword
specifies a static variable. A static variable's value is initialized the
LOCAL_VAR
first time the statement block in which it is declared is executed and retained after execution of
the statement block has finished.
The
keyword specifies a non-static variable. A non-static variable's value is re-
STACK_VAR
initialized every time the statement block in which it is declared is executed.
If neither the
nor the
LOCAL_VAR
(default).
LOCAL_VAR INTEGER INT2
STACK_VAR CHAR ARRAY1[10]
(* statements *)
and
can be used interchangeably in any statement block except for waits.
STACK_VAR
variables may be declared inside a wait block.
LOCAL_VAR CHAR TempBuf[80]
(* statements *)
LOCAL_VAR
keyword is specified,
STACK_VAR
// static (permanent)
// non-static (temporary)
NetLinx Programming Language Reference Guide
or
:
STACK_VAR
is assumed
STACK_VAR

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents