; *** Multi-Threaded Looping, using Timers ***
; Starts everything going
alias test {
set %LoopCount 1
.signal do_echo | .signal do_loop
}
; do_loop will not stop looping,
; nor will this type of looping stop event processing
on *:signal:do_loop {
inc %LoopCount | .timerSig1 1 0 .signal $signal
halt | :error
echo -a Break in $signal at LoopCount of %LoopCount $+ . $error
.timerSig1 off | .timerSig2 off | reseterror
}
; do_echo will stop when loop count is >= 1000
; and also stop script processing, stoping the first loop
; Like the prior loop does not stop event proesssing
on *:signal:do_echo {
if (%LoopCount < 999) {
echo -a Loop Count: %LoopCount
.timerSig2 1 0 .signal $signal
}
else { remote off | .timerSig1 off | .timerSig2 off }
halt | :error
echo -a Break in $signal at LoopCount of %LoopCount $+ . $error
.timerSig1 off | .timerSig2 off | reseterror
}