1
04.00 Flexible NC Programming
1.10 Strin
o
erations
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
1-53
1.10.6 Selection of a substring
This functionality makes it possible to separate a
substring from a string. For this purpose, the index of
the first character and the desired string length (if
applicable) are specified. If no length information is
specified, then the string data refers to the remaining
string.
STRING_ERG = SUBSTR
Result type: INT
STRING_ERG = SUBSTR (STRING,INT, INT)
Result type: INT
Semantics:
In the first case, the substring from the position
defined by the first parameter up to the end of the
string is returned.
In the second case, the result string is limited to the
maximum length as defined by the third parameter.
If the start position is after the string end, then the
empty string ("") is returned.
If the start position or the length is negative, then an
alarm is output.
Example:
DEF STRING [29] ERG
ERG = SUBSTR ("ACKNOWLEDGMENT: 10 to 99",
10, 2)
; ERG therefore == "10"