Hello!
Given this code, somebody can explain me why the number "2" gets repeated twice?How to do it:
- run mouseup once
- run it again after a few seconds
EXPECTED RESULT: on the second press, only one "2" should appear on the msg
OBSERVED RESULT: two occurences of the "2" appear on the msg.
Is there a way to avoid this?
Thanks
Given this code, somebody can explain me why the number "2" gets repeated twice?
CODE:
local sNumber = 2on mouseUp pMouseButton put sNumber mod 2 + 1 into sNumber --alternate 1 and 2 at each press MofifyTheRepeatend mouseUpOn MofifyTheRepeat repeat 5 put sNumber & " " after msg if sNumber = 2 then exit repeat wait 3 seconds with messages end repeat beepend MofifyTheRepeat
- run mouseup once
- run it again after a few seconds
EXPECTED RESULT: on the second press, only one "2" should appear on the msg
OBSERVED RESULT: two occurences of the "2" appear on the msg.
Is there a way to avoid this?
Thanks
Statistics: Posted by trevix — Wed Sep 04, 2024 5:48 pm