J
JellyON
Hi. I'm a little bit lost trying to insert a setTimeout() for recursive
call containing string and numeric parameters.
Here is a generic example of what I would like to succeed to do :
function Stuff(a_str, an_int, delay)
{
// Three useful vars for managing the recursivity
var stop = false; // will be true when no more recurse needed
var command; // just to concatenate the recurse expression
var timer; // timeout identifier
// ... doesn't matter the treatment ...
// Recursivity part
if (stop)
clearTimeout(timer);
else
{
command = "Stuff('" + a_str + "'," + an_int + "," + delay + ")";
timer = setTimeout(command, delay);
}
}
And it doesn't work.
I've searched in the Web and ng, tried different syntax about command
(for example, adding a ";" at the end of the command, using the
'+an_int+' syntax, etc), but doesn't succeed.
Well, I need your advice
call containing string and numeric parameters.
Here is a generic example of what I would like to succeed to do :
function Stuff(a_str, an_int, delay)
{
// Three useful vars for managing the recursivity
var stop = false; // will be true when no more recurse needed
var command; // just to concatenate the recurse expression
var timer; // timeout identifier
// ... doesn't matter the treatment ...
// Recursivity part
if (stop)
clearTimeout(timer);
else
{
command = "Stuff('" + a_str + "'," + an_int + "," + delay + ")";
timer = setTimeout(command, delay);
}
}
And it doesn't work.
I've searched in the Web and ng, tried different syntax about command
(for example, adding a ";" at the end of the command, using the
'+an_int+' syntax, etc), but doesn't succeed.
Well, I need your advice