Make two buttons. Name one "start". Name the other "stop".
in btn "start":
Code: Select all
on mouseUp
put the seconds + 8 into tSecs
showrandoms tSecs
end mouseUp
Code: Select all
on mouseup
send "showRandoms" && 0 to this card
end mouseup
Code: Select all
on showRandoms tSecs
put random(99)
if tSecs = 0 then
exit to top
end if
if tSecs > the seconds then send "showRandoms" && tSecs to me in 0 millisecs
end showRandoms
If you place a breakpoint at the "exit to top" line in the card script. the handler is caught there, and if you then step through, you exit. The "stop" button was intended to reset the variable "tSecs" to a value that will force the showRandoms to end. And it does, but only if you step through, not if you run it. The variable watcher shows a "0" as the value of tSecs, as it should, and the conditional tosses you out of the handler. As it should.
But not in a normal run, only in the debugger.
I have been chasing this since 1987. I am not crazy. I have pictures. I will start a support group.
Craig Newman