Forum Discussion
AlexKaras
14 years agoCommunity Hero
Hi Marc,
Not sure that I got you absolutely correctly, but:
a) Why not do just something like this:
while true do
DoWhatIWant();
b) If for some reason you need to use timer, than add an empty infinite loop at the end of your MainTestFunctionScript() and handle a flag signalling that your code triggered by timer is running (unless you created it to be re-enterable). Something like this:
var myTimer;
var boolInTimer;
function MainTestFunctionScript(){
boolInTimer = false;
//Setup my new timer
myTimer= Utils.Timers.Add(5000, "MainTestFunctionScript.DoWhatIWant", false);
myTimer.Name = "NotificationTimer";
myTimer.Enabled = true;
while true
aqUtils.Delay(500);
}
function DoWhatIWant(){
if (boolInTimer)
return;
boolInTimer = true;
//do something cool
boolInTimer = false;
}
Not sure that I got you absolutely correctly, but:
a) Why not do just something like this:
while true do
DoWhatIWant();
b) If for some reason you need to use timer, than add an empty infinite loop at the end of your MainTestFunctionScript() and handle a flag signalling that your code triggered by timer is running (unless you created it to be re-enterable). Something like this:
var myTimer;
var boolInTimer;
function MainTestFunctionScript(){
boolInTimer = false;
//Setup my new timer
myTimer= Utils.Timers.Add(5000, "MainTestFunctionScript.DoWhatIWant", false);
myTimer.Name = "NotificationTimer";
myTimer.Enabled = true;
while true
aqUtils.Delay(500);
}
function DoWhatIWant(){
if (boolInTimer)
return;
boolInTimer = true;
//do something cool
boolInTimer = false;
}