#module
#deffunc wordchk val, int
mref txt, 24 : mref ichi, 1
mref stt, 64
peek chk, txt, ichi
if chk = 0 : stt = -1 : return // 範囲外
if (chk > 128 & (chk < 160)) | (chk > 223) : stt = 1 : else : stt = 0 // 1byte=0 2byte=1
return
#deffunc strnum val, val
mref num, 16 : mref txt, 25
num = 0
repeat
wordchk txt, cnt
if stat = -1 : break // 範囲外
num++
if stat = 1 : continue cnt + 2 // 2byteなら2byte進める
loop
return
#global
string = "abあcdeいfうghえijおklmかnopきqくrsけtuvこwxyz"
strnum mojisuu, string
mes "「" + string + "」には\n" + mojisuu + "文字あります。"
stop
|