When running a karel program in roboguide a stack overflow error occurs, even though there is no recursion. There is no other information given by roboguide.
(ROBOGUIDE) Fanuc Karel Stack Overflow error
1k views Asked by Tedy Pranolo At
1
When running a karel program in roboguide a stack overflow error occurs, even though there is no recursion. There is no other information given by roboguide.
Check the "Stack Usage" section of your Karel manual
First try increasing the stack size of your program (add under the PROGRAM keyword)
%STACKSIZE = 4000Second, as the manual states the stack size include all parameters (there is a table in the manual that specifies the size of each data type). In my case, the culprit was my generous usage of string variable declaration
The string parameters can quickly add up, especially arrays of strings. Make sure you only declare what you need, or even better don't use the local variable if not strictly needed. In Fanuc's Karel the stack space is tight, make everything count.