Contents |
Effect
Returns the length A of a string X$, including all non-printable characters. A Hankaku accent will be counted as an independent character.
It's the same command as LEN, but adapted for Japanese and Korean characters.
Syntax
- For Japanese characters
CALL KLEN(A,X$,<Type>)
The last parameter is optional. Parameters can not end with a comma alone.
- For Korean characters
CALL KLEN(A,X$)
Parameters
A is a value that will be returned by this instruction
X$ is a a string (between quotation mark)
For a correct working, it's better to use Hangul characters regrouped in blocks.
<Type> is optional and only for Japanese characters
0: All characters (default value)
1: All the Hankaku characters
2: All the Zenkaku characters
Examples
CALL KLEN(A,"雨ニモマケズ"):PRINT A
7
CALL KLEN(A,"雨ニモマケズ",1):PRINT A
6
CALL KLEN(A,"雨ニモマケズ",2):PRINT A
1
Hankaku/Zenkaku
In the Japanese language, the following characters are hankaku (1-byte) : English alphabets, numbers, western punctuation, unaccented katakanas and hiraganas, Japanese punctuation, Japanese accents.
In the Zenkaku, 2-byte characters, you find all hiraganas and katakanas, both accented and unaccented, English alphabets, special pictograms like large circles and measurement terms, Greek and Russian fonts, and thousands of kanjis. These are contained in the big Kanji ROM (128kB if JIS1, 256kB if JIS1+JIS2).
Related to
CALL AKCNV, CALL KACNV, CALL KEXT, CALL KTYPE, LEN
Compatibility
Hangul BASIC version 3 or higher, Kanji BASIC