11 - 101 11 - 101
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
KACNV$
Function
Kanji Ank CoNVert $
• Converts a full-byte character to a half-byte character.
KACNV$ ( <character string expression> )
Syntax
character string expression
• • • •
Specify a character string to be processed.
B$=KACNV$(A$)
• • • •
Converts full-byte characters in A$ into half-byte
characters and assigns them to B$.
Examples
B$
A$
1
@ @ @ @
0 1
1
@
0 1
@@@@
Description
• The KACNV$ function converts all full-byte characters in <character string expression> into
half-byte characters. The half-byte characters in <character string expression> do not
change.
• Only the full-byte characters that correspond to the half-byte characters listed in Appendix
4.1 can be converted. An “Illegal function call” error occurs if full-byte characters other
than those are included.
• When full-byte characters that include a voiced sound symbol or semivoiced sound symbol
(@, @, etc.) are converted, Kana characters and voiced sound symbols or semivoiced
sound symbols are separated.
B$
@ @ @ @
A$
AB
C
@ @
D@
F
@ E
Program Example
10 ' Converts full-byte characters to half-byte characters
20 A$="@"
:
' Defines a character string
30 B$=KACNV$(A$)
:
' Converts into half-byte characters
40 PRINT "Before conversion-->";A$
50 PRINT "After conversion-->";B$
60 END
RUN
Before conversion-->@
After conversion-->@
OK
REMARK
See the AKCNV$ function and Section 3.13.3.