05-22-2003, 05:52 PM
Stack overflow causes:
1.- Too many levels of recursion
2.- You are exiting a GOSUB otherwise than using RETURN
3.- A LOT of local variables in a SUB /FUNCTION maybe combined with 1
4.- Recursion without an exit condition
2 and 4 are just improper programming, I suppose you are not in this case.
3 and 1 can be solved making STATIC all variables that are re-initialised at each SUB/FUNCTION call, it saves some stack space. Also you can use CLEAR at the top of the program to increase stack space.
1.- Too many levels of recursion
2.- You are exiting a GOSUB otherwise than using RETURN
3.- A LOT of local variables in a SUB /FUNCTION maybe combined with 1
4.- Recursion without an exit condition
2 and 4 are just improper programming, I suppose you are not in this case.
3 and 1 can be solved making STATIC all variables that are re-initialised at each SUB/FUNCTION call, it saves some stack space. Also you can use CLEAR at the top of the program to increase stack space.
Antoni