左円の範囲をクリックした時は、respに1を、
右円の範囲をクリックした時は、respに0を代入し、
それ以外(空白)をクリックした時は、
respに値を入れないようにしたいのですが、
上手く行きません。
elseの使い方が誤っているのでしょうか・・・
respに値を代入しているところに、
dialogを入れて見ると、範囲外の時はdialogを表示しないのですが、
respはクリックした数だけ何らかの値が入ってしまいます。
screen scrExp, ginfo_dispx, ginfo_dispy, 4, 0, 0 notesel data num = 6 sdim resp,num data ="" endloop = 0 scrWidth = ginfo_dispx scrHeight = ginfo_dispy poscircleX = (scrWidth / 2 - 100) poscircleY = scrHeight * 6 / 10 size=100;円の大きさ xleft=poscircleX-250;left yleft=poscircleY-200 xright=poscircleX+350;right yright=poscircleY-200 color 255,150,150 circle xright,yright,xright+size,yright+size;right circle xleft,yleft,xleft+size,yleft+size;left while endloop = 0 repeat await 1 stick in,0,1 if in &256{ break } loop await 1 posX=mousex posY=mousey if (posX > xleft and posX <= (xleft+size)) and (posY >= yleft and posY <= (yleft+size)){ resp = "1" ; dialog "L" }else{ if (posX > xright and posX <= (xright+size)) and (posY >= yright and posY <= (yright+size)){ resp = "0" ; dialog "R" }else{ } } data += resp onexit gosub *exi wend *exi notesel data notesave "data.txt" end