HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Would this be possible: Timer triggering its own function.

02-09-2007, 06:33 PM#1
zeroXD
Collapse JASS:
function MyFunc takes nothing returns nothing
local timer t = CreateTimer()
    call TimerStart( t, 0.5, true, MyFunc )
endfunction
I know that, if it would work, it would loop forever, but the question is: Would this work, crash the editor or give a syntax error?
EDIT: Cant check myself becasue I dont have WE avaliable right now.
02-09-2007, 06:55 PM#2
Vexorian
It works, and I use it all the time. In this case the whole looping argument as true is ineffective since each time you start a timer it stops it if it was already stopped, of course, you would have to use function MyFunc instead of MyFunc
02-09-2007, 07:39 PM#3
zeroXD
Yes, it was just an excample.
I got a function which spreads fire damage the same way as damage does with disease cloud, so it is very usefull for me.