Processes In Full-Byte Character Increments - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

3 LET'S CREATE AND EXECUTE A PROGRAM

3.13.3 Processes in full-Byte character increments

3 - 44
As shown in (5) in Section 3.13.2, a single full-byte character (Kanji character) is
considered as taking up the space equivalent to two single-byte characters in the
character processing in half-byte character increments. However, in the processing of
full-byte character increments, full-byte characters are also considered one character
when processed.
(1) Extracting a portion of a character string
The KMID$ function is similar to the MID$ function ((1) in Section 3.13.1)
explained in the processing of half-byte character increments. KMID$(A$, n, m)
creates a new character string by extracting m characters from the nth character
counting from the left within the character string A$. When this is performed, full-
byte characters are considered one character, and the result is as follows.
Example
@ @ @ @
10 A$= " A B C
20 PRINT MID$(A$, 8, 4)
30 PRINT KMID$(A$, 6, 2)
40 END
MID$
RUN
@@
@@
OK
KMID$
(2) Finding the length of a character string
The KLEN function is used to find the length of a character string containing full-
byte characters. The KLEN function has many functions, and each function is
specified by integers 0, 1, or 2.
Example
@ @ @ @
10 A$= " A B C
20 PRINT KLEN(A$,0)
30 PRINT KLEN(A$,1)
40 PRINT KLEN(A$,2)
RUN
10
6
4
OK
D E F"
A
B
C
@
@
1
2
3
4
5
6 7 8 9
1
2
3
4
5
D E F"
Displays the number of characters
A$ character string. Full-byte characters are
counted as one character when this is processed.
Displays the number of half-byte
Displays the number of full-byte characters in A$.
MELSEC-Q
@
@
D
E
F
10
11
12
13
14
6
7
8
9
10
in the entire
characters in A$.
3 - 44

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents