495
STRDEL, STRDELP
1
2
3
4
4
6
7
8
7.11
Char
acter
string processing inst
ructions
7.11.1
9
STRD
E
L
, S
T
RDELP
F
unct
i
on
(1) This instruction deletes n2 characters data in the devices specified by starting from the device (insert position)
specified by n1.
Device position where character string data to be deleted: n1 3
Number of characters to be deleted: n2 5
(2) This instruction stores the NULL code (00
H
) into the device (one word) that positions after the last device that stores the
character string data when the character string data specified by is even, after the characters are deleted.
(3) This instruction stores the NULL code (00
H
) into the last device (high 8 bits) that stores the character string data when
the character string data specified by is odd, after the characters are deleted.
(4) This instruction shifts the characters stored in the devices that position after the deleted devices by n2 characters to the
right, and then stores the NULL code (00
H
) into the empty device.
Operat
i
on
E
rror
(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.
Program
E
xamp
l
e
(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]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The number of characters in the devices specified by exceeds
16383.
The value specified by n1 is not within the range. (1
n1
16383)
The value specified by n1 exceeds the number of characters in the
devices specified by .
The value specified in n2 exceeds the number of characters between
n1 and the last character in .
The value specified in n2 is negative.
––
––
––
––
D
n1th
character
to
be
de
l
eted
T
he
characters
of
the
de
vi
ces
other
than
the
sh
i
fted
de
vi
ces
do
not
change
.
Stores
the
NULL
code
(00
H
)
i
nto
the
empty
de
vi
ces
after
sh
i
ft
i
ng
.
+
1
4
1
H
(A)
4
2
H
(B)
4
8
H
(
H
)
4
9
H
(
I
)
4
A
H
(J)
4
B
H
(
K
)
4
C
H
(
L
)
00
H
00
H
00
H
00
H
31
H
(1)
30
H
(0)
33
H
(3)
32
H
(2)
35
H
(5)
3
4
H
(
4
)
+
2
+
3
+4
+
5
b15
b8b7
b0
D
D
D
D
D
D
D
+
6
D
+
7
D
+
8
D
+
9
D
Sh
i
fts
the
n1
+
n2th
characters
and
up,
w
h
i
ch
are
stored
after
the
de
vi
ces
w
hose
characters
w
ere
de
l
eted,
by
n2
characters
to
the
r
i
ght
+
1
4
1
H
(A)
4
2
H
(B)
4
9
H
(
I
)
4
8
H
(
H
)
4
A
H
(J)
4
C
H
(
L
)
4
B
H
(
K
)
00
H
31
H
(1)
30
H
(0)
33
H
(3)
32
H
(2)
35
H
(5)
3
4
H
(
4
)
+
2
+
3
+4
+
5
b15
b8b7
b0
D
D
D
D
D
D
+
6
D
+
7
D
+
8
D
+
9
D
De
l
etes
n2
characters
from
the
n1th
de
vi
ce
and
up
+
1
4
1
H
(A)
4
2
H
(B)
4
3
H
(C)
44
H
(D)
4
5
H
(
E
)
4
6
H
(
F
)
4
8
H
(
H
)
4
7
H
(G)
4
A
H
(J)
4
9
H
(
I
)
4
C
H
(
L
)
4
B
H
(
K
)
00
H
31
H
(1)
30
H
(0)
33
H
(3)
32
H
(2)
35
H
(5)
3
4
H
(
4
)
+
2
+
3
+4
+
5
b15
b8b7
b0
D
D
D
D
D
D
+
6
D
+
7
D
+
8
D
+
9
D
D
D
D
D
D
Step
I
nstruct
i
on
De
vi
ce