Flexible NC programming
1.9 String operations
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
77
Example
Program code Comments
DEF BOOL BOOL_ERG
DEF REAL REAL_ERG
DEF AXIS AXIS_ERG
BOOL_ERG=ISNUMBER("1234.9876Ex-7") ; BOOL_ERG == TRUE
BOOL_ERG=ISNUMBER("1234XYZ") ; BOOL_ERG == FALSE
REAL_ERG=NUMBER("1234.9876Ex-7") ; REAL_ERG == 1234.9876Ex-7
AXIS_ERG=AXNAME("X") ; AXIS_ERG == X
1.9.3 Concatenation of strings (<<)
Function
The function "concatenation strings" allows a string to be configured from individual
components.
The concatenation is realized using the operator "<<". This operator has STRING as the
target type for all combinations of basic types CHAR, BOOL, INT, REAL, and STRING.
Any conversion that may be required is carried out according to existing rules.
Syntax
<any_type> << <any_type>
Significance
<any_type>: Variable, type CHAR, BOOL, INT, REAL or STRING
<< : Operator to chain variables (<any_type>) to configure a character string
(type STRING).
This operator is also available alone as a so-called "unary" variant. This
can be used for explicit type converter to STRING (not for FRAME and
AXIS):
<< <any_type>
For example, such a message or a command can be configured from text lists and
parameters can be inserted (for example a block name):
MSG(STRG_TAB[LOAD_IDX]<<BAUSTEIN_NAME)