Section 7. Installation
into an array of values (characters, floats, or longs), such as Move(),
MoveBytes(), GetVariables(), SerialInRecord(), SerialInBlock(). In all cases,
when writing to an array of values, it is important to understand what you are
reading, if you are reading it asynchronously, in other words reading it from some
other task that is polling for the data at the same time as it is being written,
whether that other task is some other machine reading the data, like LoggerNet, or
a different sequence, or task, within the same machine. If the process is
relatively fast, like the Move() instruction, and an asynchronous process is
reading the data, this can be even worse because the “reading old data” will
happen less often but is more insidious because it is so rare.
7.7.18 String Operations
String operations are performed using CRBasic string functions.
7.7.18.1 String Operators
The table String Operators (p. 303) lists and describes available string operators.
String operators are case sensitive.
String Operators
Operator Description
&
Concatenates strings. Forces numeric values to strings
before concatenation.
Example
1 & 2 & 3 & "a" & 5 & 6 & 7 = "123a567"
+
Adds numeric values until a string is encountered. When a
string is encountered, it is appended to the sum of the
numeric values. Subsequent numeric values are appended as
strings.
Example:
1 + 2 + 3 + "a" + 5 + 6 + 7 = "6a567"
-
"Subtracts" NULL ("") from the end of ASCII characters for
conversion to an ASCII code (LONG data type).
Example:
"a" - "" = 97
ASCII codes of the first characters in each string are
compared. If the difference between the codes is zero, codes
for the next characters are compared. When unequal codes
or NULL are encountered (NULL terminates all strings), the
difference between the last compared ASCII codes is
returned.
Examples:
Note — ASCII code for a = 97, b = 98, c = 99, d = 100, e =
101, and all strings end with NULL.
Difference between NULL and NULL