Hello:
I have to cancel the timers I have at some point.
I use many functions with timer.performWithDelay( )
then I check if I am using the timer, so I can cancel it.
if t1 ~= nil then
timer.cancel(t1)
end
it works perfect if I have 3 or 5 timers I do this
if t1 ~= nil then
timer.cancel(t1)
end
5 times
if t1 ~= nil then
timer.cancel(t1)
end
if t2 ~= nil then
timer.cancel(t2)
end
if t3 ~= nil then
timer.cancel(t3)
end
if t4 ~= nil then
timer.cancel(t4)
end
if t5 ~= nil then
timer.cancel(t5)
end
but now I have 60 times, just imagine that long line in my code
QUESTION…
How can I do that with less lines of code? a loop? a function? what?
Thanks for all your help
Victor