User Guide

Arrays and Strings
33
Axcess Programming Language
pushes, PUSH [TP, 25] through PUSH [TP,31], are the buttons for PRESETS 1 through 7. Inside
the block is an IF statement; the IF statement uses the state of the variable STORE_VOL_PRESET
to determine whether to assign the volume card's level to a location in the VOL_PRESETS array, or
to send a command to the volume card telling it to go to a previously stored level. To place the
variable VOL_LEVEL into the array VOL_PRESETS at the correct location, 24 must be subtracted
from PUSH_CHANNEL to find the index value.
Strings
In many cases you may need to transfer a series of data values at once. You can do this by using
strings and string expressions. A string is a set of values grouped together with single and/or double
quotes. Strings enclosed in single quotes are called string literals. Examples of strings include
names and the actual command portion of SEND_COMMAND statements.
String literals
Single quotes can only enclose values ranging from decimal 32 (the space character) to decimal 126
(the tilde character '~'). These string literals are constant values that are set at compile time. Once
loaded into the Central Controller, these strings cannot be changed, except when a new program is
loaded into the Central Controller.
Here is an example of a string literal assigned to an array:
PRESETS='FOUR'
When Axcess processes this assignment, it places the F (ASCII value 70) in location 1 of
PRESETS, Ø (ASCII value 79) in location 2, and so on, as shown in FIG. 9. String FOUR is placed
in the array PRESETS.
String expressions
Single and double quotes are interpreted in two different ways by Axcess. Single quotes enclose
string literals, double quotes enclose string expressions. A string expression combines several types
of data into a single string. It can contain any ASCII value (Ø to 255), variables, string literals, and
arrays. The difference between a string literal and the string expression is that the string expression
is built at run time instead of compile time. As Axcess processes a string expression, it evaluates
each member of the expression from left to right; the result is a complete string. For example:
DEFINE_PROGRAM
TEMP = "SCREEN_UP,5,Ø,'NO',X"
An index value is not given when strings are assigned to arrays. The first letter is automatically
placed into the first storage location; the second letter is placed into the second storage location,
and so on.
FIG. 9 The string FOUR is assigned to the array PRESETS