Recursivity in scripts !
by Claude-Alain Fournier · in Torque Game Engine · 10/20/2004 (1:41 am) · 2 replies
Hi,
I made this small code to test recursivity :
Good new is it work in Torque script and can recurse to quite a few levels. The limit I found is 2286 levels, one more and I get a "stack overflow" assert.
It will be interesting to know if this is a fixed limit or dependent on other parameters like memory, operating system etc... So if a few peoples could test it, I think it will give some interesting informations on the recursivity limits.
It will be nice is some GG developer can comment on this.
Regards,
CAF
I made this small code to test recursivity :
function testRecursiveStart()
{
echo("Start Test") ;
testRecursive(1) ;
echo("Stop Test") ;
}
function testRecursive(%i)
{
if(%i == 2286)
{
echo("Reached Bottom") ;
return ;
}
echo("Open Level : " @ %i) ;
%i++ ;
testRecursive(%i) ;
echo("Close Level : " @ %i) ;
}Good new is it work in Torque script and can recurse to quite a few levels. The limit I found is 2286 levels, one more and I get a "stack overflow" assert.
It will be interesting to know if this is a fixed limit or dependent on other parameters like memory, operating system etc... So if a few peoples could test it, I think it will give some interesting informations on the recursivity limits.
It will be nice is some GG developer can comment on this.
Regards,
CAF
Torque Owner Josh Williams
Default Studio Name