CALL KMID
This page was last modified 03:51, 29 November 2016 by Mars2000you.

Contents

Effect

Returns a substring B$ of variable length starting at a variable position in an input string A$.

It's the same command as MID$, but adapted for Japanese and Korean characters.

For a correct working, it's better to use Hangul characters regrouped in blocks.

A Hankaku accent will be counted as an independent character.

Syntax

CALL KMID(B$,A$,<offset>[,<length>])

Parameters

B$ is the substring that will be returned by this instruction.

A$ is a a string (between quotation mark)

<offset> is between 1 and 255
When offset = 1, CALL KMID replaces the LEFT$ command
CALL KMID(B$,A$,1,3) is equivalent to B$=LEFT$(A$,3)

<length> is optional and between 0 and 255
If no length is specified then the entire substring starting at offset position is returned

CALL KMID can also replace the RIGHT$ command, if offset = A-(length)+1 with A = length of string A$, defined by CALL KLEN
For example, if A=5 then CALL KMID(B$,A$,4,2) is equivalent to B$=RIGHT$(A$,2)

Example

CALL KMID(B$,"今琵は暑いですか",4,2):PRINT B$
暑い

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 KLEN, LEFT$, MID$, RIGHT$

Compatibility

Hangul BASIC version 3 or higher, Kanji BASIC