Omron WS02-CXPC1-V9 - V9 Operation Manual page 216

Table of Contents

Advertisement

Function Descriptions
• Example
Variables
STRING Message1
STRING Result
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
Variable name
Source_string
Replace_string
Number_of_characters
Position
Return_value
• Example
Message 1
Variables
STRING Message1
STRING Message2
STRING Result
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
Source_string
Find_string
Return_value
190
Message
A
B
C
D
Result:=DEL(Message1,4,2);
→ "AFGH" is stored in the Result variable.
Data type
STRING
STRING
INT, UINT
INT, UINT
STRING
A
B
C
D
E
Result:=REPLACE(Message1,Message2,2,3);
→ "ABXYEFGH" is stored in the Result variable.
Result
Data type
STRING
STRING
INT
E
F
G
H
Result
A
F
G
H
Description
Specifies the text string in which to replace
characters.
Specifies the replace text string.
Specifies the number of characters to be
replaced.
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).
Returns the text string with the characters
replaced.
Message 2
F
G
H
X
A
B
X
Y
E
F
Description
Specifies the text string to search.
Specifies the text string to find.
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).
Appendix C
Y
Z
G
H

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents