Author Topic: A looping tick?  (Read 745 times)

I hardly understand how this would work.

I know that if I don't do it correctly, it will cause an infinite loop and crash.

But there IS a way to do this without a crash.

Anyone know?

Example code:
Code: [Select]
function loopingfunctionname(%possibleArgs)
{
cancel($uniqueFunctionScheduleNameHere);
//stuff here
$uniqueFunctionScheduleNameHere = schedule(MS FOR TICKS, 0, loopingFunctionName, %possibleArgs);
}
loopingFunctionName(%PossibleArgs);

Example code:
Code: [Select]
function loopingfunctionname(%possibleArgs)
{
cancel($uniqueFunctionScheduleNameHere);
//stuff here
$uniqueFunctionScheduleNameHere = schedule(MS FOR TICKS, 0, loopingFunctionName, %possibleArgs);
}
loopingFunctionName(%PossibleArgs);

Oh cool. I'll try that, thanks!

:D