ごめんなさい21行間違ってました if y>smax then y=0 です その上、決定ボタンの判定もないし 19行の下辺りに if b and #a then ret=y:break と書いといてください