
7-232
RIGHT(P),LEFT(P)
7.11.15 Extracting character string data from the right or left
(RIGHT(P),LEFT(P))
RIGHT(P),LEFT(P)
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
, in devices starting from that whose number is designated by .
When n 5
: Character string or head number of the devices where the character string is stored (character string)
: Head number of the devices where the character string consisting of n characters starting from the right or
left of will be stored (character string)
n : Number of characters to be extracted (BIN 16 bits)
Setting
Data
Internal Devices R, ZR J\ U\G Zn Constants Other
Bit Word Bit Word K, H $
–– –– –– ––
–– –– –– –– ––
n–– ––
Process
High
performance
Redundant
Universal
Basic
Command
P
n
n
SD
Command
RIGHTP,LEFTP
RIGHT,LEFT
indicates an instruction symbol of RIGHT/LEFT.
SD
S
D
S
S
D
SD
+1
ASCII code for the 1st character
ASCII code for the 2nd character
ASCII code for the 3rd character
ASCII code for the 4th character
ASCII code for the (last - n + 1)th characterASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - n + 4)th character
ASCII code for the (last - 2)th character
ASCII code for the (last - 1)th character
ASCII code for the last character
00H
+1
ASCII code for the (last - n + 1)th character
ASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - n + 4)th character
ASCII code for the (last - 2)th character
ASCII code for the (last - 1)th character
ASCII code for the last character
00H
b15 b8b7 b0
S
S
b15 b8b7 b0
D
D
+1
41H (A)42H
(B)
43H (C)44H
(D) +1
31H
(1)32H (2)
33H
(3)34H (4)
45H (E)46H
(F)
31H (1)32H
(2)
33H (3)34H
(4)
35H (5)
00H
+2
+3
+4
+5
+235H
(5)00H
ASCII code for the 5th character
"ABCDEF12345"
"12345"
b15 b8b7 b0
S
S
S
S
S
S
D
D
D
b15 b8b7 b0