HSPのコンソールで何か選ばせることがあるならこういうようにしたらユーザービリティあっていい感じかなって。
#runtime "hsp3cl"
#module Program
#uselib "crtdll"
#cfunc getch "_getch"
#cfunc kbhit "_kbhit"
;カーソルの移動
#defcfunc move int _ch,int max
if _ch=$4b :cursol-- ;左
if _ch=$4d :cursol++ ;右
if cursol<0 :cursol=0
if max-1<cursol :cursol=max-1
return cursol
;カーソルの表示
#deffunc cursolShow array items,int csl
dim slct,length(items)
slct(csl)=1
s=""
foreach items
if slct(cnt): s+=strf("[%s]",items(cnt)): else: s+=strf(" %s ",items(cnt))
loop
mes strf("%s\r",s),1
return
#deffunc main
items="壱","弍","参","四","五","六","七","八","九","拾"
cursolShow items,0
repeat
if kbhit() {
ch=getch()
if ch=$0d {
mes ""
break
}
if ch=$e0 {
cursolShow items,move(getch(),length(items))
}
}
loop
mes strf("SelectedItem: %s",items(cursol))
return
#global
main