Hardware manual

Commands and Functions R-V Impact Reference Guide
Datalogic Automation Inc. 5-26
SPLIT "10,11,12" by "," to sub1, sub2, sub3, sub4 yields
sub1 = 10
sub2 = 11
sub3 = 12
(sub4 is undefined)
If there are fewer variables than sub-strings, the last string variable will hold the remaining part of the origi-
nal string and the delimiter. Example,
SPLIT "10,11,12" by "," to sub1, sub2 yields
sub1 = 10
sub2 = 11, 12
If two delimiters follow each other, the resulting variable is empty. Example:
SPLIT "10, ,11" by "," to sub1, sub2, sub3 yields
sub1 = 10
sub3 = 11
(sub2 is empty)
All variables are considered strings when they are split. You need to convert those string values into real val-
ues using the VAL function if you want to compare them as numbers. If the values are not converted, they
are compared as strings and the string "17.32" is evaluated as greater than "115.22." Example:
temp_string = "17.32,115.22"
SPLIT temp_string by "," to a,b
real_value_of_a = VAL(a)
real_value_of_b = VAL(b)
if real_value_of_a > real_value_of_b then
greatest = a
else
greatest = b
end if
SPLITA
The syntax of this function is
SPLITA string by delimiter to array_variable
This function splits "string" into array elements in "array_variable" separated by "delimiter." Delimiters at
the beginning or end of the expression are ignored. Example:
SPLIT "10, 11, 12" by "," to var_array yields
var_array[0] = 10
var_array[1] = 11
var_array[3] = 12
If two delimiters follow each other, the resulting array element is empty.Example,
SPLITA "10, ,11" by "," to var_array yields
var_array[0] = 10
var_array[1] =
var_array[3] = 11
(the second array element is empty)
SQR
This function returns the square root of the argument. If the argument is undef, the result is undef. Example:
y = SQR(9.0) yields y = 3
STOP