Hardware manual
Arrays Impact Reference Guide
Datalogic Automation Inc. 5-6
Repeat Until
Repeat
REM loop body
Until expression
This construct repeats the loop body until the expression is True. The expression is evaluated after the exe-
cution of the loop body so the loop body is always executed at least once.
While
While expression
REM loop body
End
This construct repeats the loop body while the expression is True. The expression is evaluated before enter-
ing the loop so the loop is not executed if the expression is already False.
Arrays
In the Basic tool, the Boolean List, Integer List, and Real List data types are arrays. Variable values that are
not linked into array variables in the tool are preserved between tool executions. If you want to clear an array
of all values, assign the "undef" value. For example:
undef mylist
assigns an undefined value to all elements in the array "mylist."
To access a list element, use the variable name followed by the list element within brackets.
NOTE: All the list data types are zero based, that is, the first element of the list is zero. For example, if an
array contains five elements, the first element is number zero and the final element is number four.
For example, to assign a value to the third element in the mylist variable:
mylist[2] = 5.5
You can use a loop construct to loop through all the elements in a list variable. For example:
For loopcount = 0 to 14
mylist[loopcount] = True
Next
The reserved words "lbound" and "ubound" refer to the lower and upper bounding index of an array. You can
use these to process an array of unknown length. For example, to process a Boolean List of unknown length:
For loopcount = lbound(mylist) to ubound(mylist)
if mylist[loopcount] = False then
sum = sum-1
endif
Next
You can also extend an array by assigning a new value to the upper bounding index value. Array indices can
be negative, but if the array is linked into another tool, the index of the first array element will still be zero.
You can define temporary multi-dimensional arrays (the data is not maintained between tool executions).
Use the following syntax to access a multi-dimensional array:
mylist [firstdim,seconddim]
Data Types
Variables in the Basic tool can be one of the following types: Boolean, Boolean List, Integer, Integer List,
Real, Real List, and String. List types can be accessed using array notation. After a variable is defined in the