Expanding the Operator Interface (BE1) 08/2005
3 Syntax
© Siemens AG, 2005. All rights reserved
BE1/3-100 SINUMERIK 840D sl/840D/840Di/810D HMI Installation and Start-Up Guide (IAM) – 08/2005 Edition
Find a character
Syntax:
INSTR(start, string1, string2 [,direction])
Parameter:
start Number, position from which string1 is searched for in string2.
This parameter defines the start position for the search. Enter 0
to start searching at the beginning of string2.
string1 Character that is being searched for.
string2 Chain of characters in which the search is being made
direction Optional. Defines the search direction.
0: From the left to the right,
1: From the right to the left.
If not specified, then direction = 0
Function:
INSTR returns the position of the first occurrence of a specified character in a
string.
Note:
0 is returned if string1 does not occur in string2.
Example:
DEF VAR01
DEF VAR02
LOAD
VAR01="HELLO/WORLD"
VAR02=INST(1,"/",VAR01) ;Result = 6
END_LOAD
Substring from left
Syntax:
LEFT(string, length)
Parameter:
string Character string or variable with the string to be
processed
length Number of characters that are to be read out
Function:
LEFT returns a string containing the specified number of characters starting from
the left-hand side of a string.