580
7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
• If the number of characters designated by (S2)+1 is "-1", stores the data up to the final character designated by (S) starting
from the device designated by (D).
■MIDW
• Extracts the character string data of (S2)+1 characters, starting from the left end of the character string data designated by
(S1), and stores the extracted data to the character string data designated by (D) in the area starting from the position
designated by (S2) from the left end.
• The NULL code (00H) indicating the end of the character string is automatically added to the end of the character string.
Refer to Page 91 Using character string data for the format of the character string data.
• If the number of characters designated by (S2)+1 is "0", the NULL code (00H) is stored at the start of (D).
+1
41
H
(A)42
H
(B)
43
H
(C)44
H
(D)
+1
45
H
(E)46
H
(F)
47
H
(G)48
H
(H)
45
H
(E)46
H
(F)
47
H
(G)48
H
(H)
49
H
(I)4A
H
(J)
4B
H
(K)00
H
+2
+3
+4
+5
+2
49
H
(I)
4A
H
(J)
Position of
the 5th
character
"ABCDEFGHIJK"
"EFGHIJK"
5
1
+1
4B
H
(K)00
H
+3
D
D
D
D
S
1
S2
b15 b8
b7
b0
S1
S
1
S
1
S
1
S
1
S2
b15 b8b7 b0
S2
+1
30
H
(0)31
H
(1)
32
H
(2)33
H
(3)
b15 b8b7
b0
34
H
(4)35
H
(5)
36
H
(6)37
H
(7)
38
H
(8)00
H
+2
+3
+4
"012345678"
+1
41
H
(A)42
H
(B)
43
H
(C)44
H
(D)
+2
45
H
(E)46
H
(H)
"ABCDEFGHI"
47
H
(G)48
H
(H)
+3
49
H
(I)
00
H
+4
Before execution
+1
41
H
(A)42
H
(B)
30
H
(0)31
H
(1)
+2
32
H
(2)33
H
(3)
"AB012345I"
34
H
(4)35
H
(5)
+3
49
H
(I)00
H
+4
After execution
3
6
+1
Number of characters counted
from the left end of the character
string data designated by
Position counted from the left
end of character string data
designated by
S1
D
D
D
D
D
S2
S1
S
1
S
1
S
1
S2
D
D
D
D
D
b15 b8
b7
b0
b15 b8
b7
b0
S1
D