The weird thing about this is that it finishes implying that everything went okay. Then when you try to exit the app it crashes.
After playing with the numbers it looks like 99 recursive calls is the max you can perform.
I went snooping around the interpreter code and found this:
// Create subroutine stack
g_dwSubroutineStackMax = 100;
g_pSubroutineStack = new sByteCode* [ g_dwSubroutineStackMax ];
g_pSubroutineStackEBPStore = new char* [ g_dwSubroutineStackMax ];
g_dwSubroutineStackIndex = 0;
// Create user function stack
g_dwStackMax = 10240;
g_pStack = new char [ g_dwStackMax ];
memset ( g_pStack, 0, g_dwStackMax ); // 171011 - clear function stack (as users expect local vars to be zero!!)
g_pStackPtr = g_pStack;
g_pStackPtrEBP = g_pStack;
g_pStackEnd = g_pStack + g_dwStackMax;
g_pStackPtrStartOfLocalVarMemBlock = NULL;
If I'm reading this correctly (probably not) but it looks like you're allowed up to 100 recursive calls (maybe 99 recursive + the original function call) with the total size of the recursion taking up to 10240 bytes. This is v107 btw. Edit- I should point out that I don't know if the stacks are increased in size at runtime.
Quote: " But surly 100 recursions is not too many, I actually need thousands"
I agree. 1000 recursive calls isn't stretching it too far (depending on the size of your function). Ask Paul.