7-244
STRDEL(P)
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns on, and an
error code is stored into SD0.
• The number of char acters in the devices specified by exceeds 16383.
(Error code: 4100)
• The value specified by n1 is not within the range. (1 n1 16383) (Error code: 4100)
• The value specified by n1 exceeds the number of characters in the devices specified by
. (Error code: 4100)
• The value specified by n2 exceeds the number of characters in the devices starting from
n1th to the last devices position. (Error code: 4100)
• The value specified by n2 is negative. (Error code: 4100)
Program Example
(1) The following program deletes the fourth to the seventh characters in the character string
data stored in the devices D0 and up, when M0 is turned on.
[Ladder Mode] [List Mode]
[Operation]
D
D
Step Instruction Device
D0 50H (P)52H (R)
4FH (O)47H (G)
52H (R)41H (A)
4D
H (M)41H (A)
42H (B)43H (C)
00H44H (D)
D1
D2
D3
D4
D5
Fourth character
to be deleted
D0 character string D0 character string
D0 character string
P R O G R A M A B C D
D0 50H (P)52H (R)
4FH (O)47H (G)
52H (R)41H (A)
4D
H (M)41H (A)
42H (B)43H (C)
00H44H (D)
D1
D2
D3
D4
D5
D0 50H (P)52H (R)
4FH (O)
00H
44H (D)D1
D2
P R O D
Seven characters to be deleted
P R O G R A M A B C D