![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241216.webp)
190
Function Descriptions
Appendix C
• Example
REPLACE: Replace Characters
• Function
Replaces the specified number of characters starting from the specified position of the specified text
string.
• Application
Return_value
:= REPLACE
(Source_string, Replace_string, Number_of_characters, Position)
;
• Arguments and Return Values
• Example
FIND: Find Characters
• Function
Finds the first occurrence of the specified text string in another text string and returns the position.
If the text string is not found, 0 is returned.
• Application
Return_value
:= FIND
(Source_string, Find_string)
;
• Arguments and Return Values
Variable name
Data type
Description
Source_string
STRING
Specifies the text string in which to replace
characters.
Replace_string
STRING
Specifies the replace text string.
Number_of_characters
INT, UINT
Specifies the number of characters to be
replaced.
Position
INT, UINT
Specifies the position from which to
replace characters. The first character is
position “1” (e.g., position 1 is “A” in mes-
sage 1 in the following illustration).
Return_value
STRING
Returns the text string with the characters
replaced.
Variable name
Data type
Description
Source_string
STRING
Specifies the text string to search.
Find_string
STRING
Specifies the text string to find.
Return_value
INT
Returns the position of the first occurrence of
the find text string. The first character is position
“1” (e.g., position 1 is “A” in message 1 in the fol-
lowing illustration).
Message
Variables
STRING Message1
STRING Result
Result:=DEL(Message1,4,2);
→
"AFGH" is stored in the
Result
variable.
Result
A
B
C
D
E
F
G
H
A
F G H
Message 1
Variables
STRING Message1
STRING Message2
STRING Result
Result:=REPLACE(Message1,Message2,2,3);
→
"ABXYEFGH" is stored in the
Result
variable.
Result
A
B
C
D
E
F
G
H
A
B
X
Y E F G H
X Y Z
Message 2
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......