3 - 45 3 - 45
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
(3) Converting full-byte characters to code equivalents
Each full-byte character has a corresponding JIS code. JIS$ and KNJ$ are used
for conversion between full-byte character and JIS codes. Please note that the
character codes for these functions use character strings.
Example
OK
PRINT JIS$("@")
2422
OK
PRINT KNJ$( "2424" )
OK
Remember that the
character code is a
character string,
not a numeric value.
("@")
JIS$
KNJ$
"2422"
1 character
Character
@
(4) Converting full-byte characters (Kanji characters) and half-byte
characters
There are characters among full-byte characters that are the same type of
characters as half-byte characters (alphabets, numbers, English symbols, and
Katakana). These characters can be converted between full-byte characters and
half-byte characters.
AKCNV$ function is used for converting half-byte characters to full-byte
characters (Kanji characters).
KACNV$ function is used for converting full-byte characters (Kanji characters) to
half-byte characters.
Example
10 A$= " ABC"
20 PRINT AKCNV $(A$)
30 B$= "@ @ @ @ @"
40 PRINT K ACNV$ (B$)
50 END
RUN
ABC
OK
An Illegal Function Call error will be
generated if anything other than
alphabets, numbers, English symbols,
Katakana, or Hiragana characters are
contained in the character string that is
to be converted by the KACNV$ function.
@ @ @ @ @