December 2001 Commands for String Processing 7 – 153
7.9.4 OVERWRITING A STRING (OVWR)
Syntax: OVWR (OVERWRITE)
Operands: S <arg>
Action:
Save the string from the string accumulator in a string memory. This command
differs from the = command in that the TNC does not transfer the “string end”
character along with it. In this way you can overwrite the beginning of a string
that is already in the string memory. The memory into which the TNC is to
copy the string is selected through the argument <arg> after the operand
designation. Permissible arguments: 0 to 7: (String memory S0 to S15). See
also “Operand declaration.”
Example:
This example also applies to the string commands L, + and =.
Add a string from the string memory S0 to an immediate string. The result is
to overwrite the contents of string memory S1. Initial state:
Immediate String = HYDRAULICS
String memory S0 = OIL
String memory S1 = COOLANT MISSING
Final state:
String memory (characters)
1 ...128
S0 OIL
S1 COOLANT MISSING
...
Function STL String accumulator (characters)
1 ...128
Load the string into
the string
accumulator.
L S “HYDRAULICS” HYDRAULICS
Add content of string
memory S0 to string
accumulator.
+ S0 HYDRAUL. OIL
Overwrite content of
string memory S1
with content of
string accumulator.
OVWR S1 HYDRAUL. OIL
String memory (characters)
1..128
S0 OIL
S1 HYDRAUL. OIL MISSING
...