Using Buffers
If the buffer is full when a character needs to be inserted into it, Axcess drops the first character and
shifts the contents of the buffer to the left, and inserts the new character at the end of the buffer, as
shown in FIG. 24.
FIG. 24 Inserting a character into a full buffer causes the first character to be dropped.
Retrieving characters
Use the keyword GET_BUFFER_CHAR to retrieve characters. This keyword has a two-part
operation:
!
!
Here is the syntax:
string = GET_BUFFER_CHAR (array)
The parameter passed to GET_BUFFER_CHAR must be an array, but does not need to be a buffer.
Remember that all buffers are arrays, but not all arrays are buffers. The statement will operate
identically in either case. The result must be a simple variable (not an array), because only one
character will be returned.
These examples show how to create an array called SWT_BUFFER with a capacity of a hundred
characters, and how to make it a buffer associated with a device named SWT.
DEFINE_DEVICE
SWT
DEFINE_VARIABLE
SWT_BUFFER[1ØØ]
TEMP_CHAR
DEFINE_START
CREATE_BUFFER SWT,SWT_BUFFER
Now all string data sent to the Central Controller from the device SWT will go into the array
SWT_BUFFER.
74
First, it retrieves the first character in the buffer for your own utilization. This creates the
same effect as if you retrieved the first storage location of a normal string array.
Second, it removes that character from the buffer, causing all the other characters to shift
up one place. The second character is now the first, the third is now the second, and so on.
= 1
(* AXC-232: AUTOPATCH 4YDM *)
(* BUFFER FOR SWITCHER *)
(* FOR PARSING ABOVE *)
Axcess Programming Language
Need help?
Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?