Interrupting a counter
Posted: Mon May 11, 2009 12:02 am
I have set up a counter and I want to be able to to click on a button and get the count whilst it is still running. at the moment I have to stop the counter. Is there a way I can set the counter to run in the background so that I can still complete other tasks while it is running?
Code: Select all
put "" into tQty
put "" into gN
put fld "QTY" - 1 into tqty
if gCompleted <> "" then
put gCompleted + 1 into tcounter
else
put 1 into tcounter
end if
set the ustopped of me to false
--put tqty - gCompleted
repeat tqty - gCompleted times
put "" into gCompleted
add 1 to tcounter
wait 0.25 seconds
put tcounter into N
send "tmUpdateGauge N" to group g6
put (N / tqty)*100 into gN
send "tmUpdateGauge gN" to group g2
wait 10 milliseconds with messages
if the uStopped of me is true then
put N into gCompleted
exit repeat
end if
end repeat