Did you try that yourself?
This is no better than the original. The subroutine named “catchKeys” doesn't catch any keys – just as in the original code example, they are simply passed on while the thread is running. (In fact, I could squeeze in many more characters before the output – but that of course depends on the timing choice). But even if it caught all keys, it would be very cumbersome: I would have to chop up my actual computation code into many small steps, one for each iteration of the loop.
But I do have one understanding question. What do you achieve by setting the Period for SetTimer
is undocumented. One would expect that to evaluate to 0
. Unfortunately, the documentation isn't explicit about 0
, either. If that counts as a positive number, then it would infinitely repeat. That doesn't happen, though (regardless of the sign I put before “0”). Rather, it appears execution just jumps to the label, as if it were a Gosub
command. So what am I missing?