Array Manipulation Keywords - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

Arrays and Strings
DEFINE_PROGRAM
TEMP[1] = SCREEN_UP
TEMP[2] = 5
TEMP[3] = Ø
TEMP[4] = 'N'
TEMP[5] = 'O'
TEMP[6] = X
CAM_PRESETS = TEMP
The contents of the array CAM_PRESETS, after this code is executed, depend on the length value
of the TEMP variable. If this were the entire program, TEMP would have a default length of Ø, so
nothing would be copied into CAM_PRESETS. To assure that CAM_PRESETS holds a copy of
TEMP, you would first need to set the length value of the TEMP array with this line inserted before
the copy statement:
SET_LENGTH_STRING(TEMP,6)
The line above, when executed with the previous code example, renders the following result:
TEMP = "SCREEN_UP,5,Ø,'NO',X"
After this, the length value of TEMP is 6; so, the first 6 locations of TEMP will be used in all cases
where you refer to the entire array.

Array Manipulation Keywords

The following keywords allow you to manipulate arrays and retrieve certain portions of an array:
Array Manipulation Keywords
LEFT_STRING
RIGHT_STRING
MID_STRING
36
LEFT_STRING returns a string containing the number of characters specified
starting at the beginning of the string.
For this keyword, you must specify two parameters: the string or array you are
referencing and the number of characters you need.
Example:
STR = LEFT_STRING (PRESETS,3)
After execution of this line, the array STR will contain the first 3 characters of
the array PRESETS. If PRESETS contains the string 'HELLO', then STR will
contain 'HEL.' Also, the length value of STR will be set to 3.
This keyword requires the same parameters as LEFT_STRING. However,
RIGHT_STRING begins reading at the end of the string array for the specified
amount of characters.
Example:
STR = RIGHT_STRING (PRESETS,2)
Assuming PRESETS still contains 'HELLO', replacing LEFT_STRING in the
previous example with RIGHT_STRING will assign the string 'LLO' to STR.
This keyword also will set the length value of the array receiving the result.
This keyword returns the specified amount of characters starting at a specified
location in the source string. Three parameters, rather than two, are needed for
its operation: the string to reference, the position at which to start, and the
number of characters to return.
Example:
STR = MID_STRING (PRESETS,2,3)
This line tells Axcess: "Place three characters from the array PRESETS, start-
ing at location 2 and moving to the right, into the array variable STR." If PRE-
SETS contains 'HELLO', this line will assign 'ELL' to the array STR. This
keyword also will set the length value of the array receiving the result.
Axcess Programming Language

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Axcess

Table of Contents