7.11.15 RIGHT, RIGHTP
Extracting character string data from the right
LEFT, LEFTP
Extracting character string data from the left
7.11.15
RIGHT, RIGHTP, LEFT, LEFTP
RIGHT, LEFT
RIGHTP, LEFTP
: Character string or head number of the devices where the character string is stored (character string)
S
: Head number of the devices where the character string consisting of n characters starting from the right or left of
D
n
: Number of characters to be extracted (BIN 16 bits)
Internal Devices
Setting
Data
Bit
Word
––
S
––
D
n
Function
RIGHT
(1) Stores n number of characters from the right side of the character string (the end of the character string) being stored in
devices starting from that whose number is designated by
by
.
D
b15
b8b7
S
ASCII code for the 2nd character
+1
S
ASCII code for the 4th character
ASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 4)th character
ASCII code for the (last - 1)th character
00
H
When n
5
b15
b8b7
S
42
(B)
H
S
+1
44
(D)
H
S
+2
46
(F)
H
S
+3
32
(2)
H
S
+4
34
(4)
H
S
+5
00
H
"ABCDEF12345"
(2) The NULL code (00
) indicating the end of the character string is automatically appended at the end of the character
H
string. Refer to Page 90, Section 3.2.5 for the format of the character string data.
(3) If the number of characters designated by n is "0", the NULL code (00
Command
Command
J
\
R, ZR
Bit
b0
ASCII code for the 1st character
ASCII code for the 3rd character
ASCII code for the (last - n + 1)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - 2)th character
ASCII code for the last character
b0
41
(A)
H
43
(C)
H
45
(E)
H
31
(1)
H
33
(3)
H
ASCII code for the 5th character
35
(5)
H
RIGHT, RIGHTP, LEFT, LEFTP
High
Basic
performance
indicates an instruction symbol of RIGHT/LEFT.
S
P
S
Zn
U
\G
Word
––
––
, in devices starting from that whose number is designated
S
b15
b8b7
D
ASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 1)th character
D
+1
ASCII code for the (last - n + 4)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - 1)th character
ASCII code for the (last - 2)th character
00
ASCII code for the last character
H
b15
b8b7
D
32
(2)
H
D
+1
34
(4)
H
D
+2
00
H
"12345"
) will be stored at
H
Process
Redundant Universal
LCPU
n
D
n
D
will be stored (character string)
S
Constants
K, H
$
––
––
––
––
b0
b0
31
(1)
H
33
(3)
H
35
(5)
H
.
D
1
2
3
4
Other
––
4
––
––
6
7
8
485