Stack overflow error

Andrei IRL

Senior Member
Hi everyone.
Im just finalizing my code and came across the following error when running the code in Simulator (not straight away but after a while): Stack overflow - more gosubs then returns.
The code looks good and everything is working fine. Is it just Editor error or will i have a problem with the program running on PICAXE as well?
Many thanks in advance.
 
Last edited:

techElder

Well-known member
You actually have to place RETURN statements after a subroutine call.

A quick scan of your code doesn't show any RETURN statements.
 

Andrei IRL

Senior Member
You actually have to place RETURN statements after a subroutine call.

A quick scan of your code doesn't show any RETURN statements.
Thanks very much. I have no idea how but i got away without RETURNS so far.
I have the code corrected now with returns and haven't had any errors.
Thanks very much for your help.
 

premelec

Senior Member
Andrei - you are lucky you weren't driving something that would burn up when stalled... on a simulator it's not much of a problem :)
 
Top