Chapter 6 Instruction Details
XBC E-Type Main Unit 6-256 Ve r. 1
6.34.14 REPLACE, REPLACEP
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
REPLACE(P)
4~6 O - -
S1 Start address of string to replace STRING
D Start address of string STRING
S2 Position (S2+0) and replaced size (S2+1) of the string to be replaced in D WORD
[Flag Setting]
Error
1. If S2+1’s value exceeds D’s string length
2. If S2’s value exceeds D’s string length
F110
1) REPLACE
(1) Replaces string data (from the left) saved in device number D including specified S2 and S2+1’s number
of characters data, with specified S1’s string.
(2) If S2+1 is 0, S1 will be inserted in specified S2 position of string specified in D.
(3) If S1’s string length is different from S2+1’s string size, D’s string may keep increasing or deceasing,
which needs user’s precaution.
2) Program Example
P00000
REPLACE P1000 P1100 P1200
Position from the left of D’s string data
The number of characters to be replaced
from S2