out of stack space/ over my head
Hello Everyone. I have written a 500 lines of code that takes data out of a flight simulator and displays it on a led display. The program runs fine for about 5 minutes then crashes with "out of stack space" stated by the editor. I know I am over my head just visiting MSDN's website and hearing talk of "procedures too deeply nested" and " recursive procedures not terminated correctly". ( I really am at the "Visual Basic for Dummies" level.)
First I apologize for being tremendously vague and uninformative. I really am just a novice that worked really hard just to get to this point. I think it might be time to try and find a consultant who could offer suggestions but I don't know the best way to go about that. I would post the code here only with permission from the moderator because I think that might too presumptuous.
(it has 4 forms and a module).
Thank you again.
curtis.
Re: out of stack space/ over my head
Better zip and attach your Project to your next post
Re: out of stack space/ over my head
The error basically means that there are too many routines (Subs/Functions) running at the 'same' time - you have started a very large amount of routines that haven't finished running yet.
This is almost certainly due to you accidentally having done something "recursive", which means a routine somehow manages to run another copy of itself. In cases like this it is generally due to one of these causes:
- You have code in a _Change event (or similar) that makes a change to the value of the control - and thus runs itself again.
- One routine calls another (that perhaps calls another, etc), which under some circumstances calls the first one, thus creating a kind of 'loop' that never ends.
- You have got code in a Timer, but the code takes more time to run than the Interval.
Quote:
I would post the code here only with permission from the moderator because I think that might too presumptuous.
You don't need permission, feel free to attach it. :)
While it is generally good to not post lots of code unless somebody asks for it (as usually we only need to see a small part, if anything), cases like this depend on several parts of the program - so to be able to help much more than I have in this post, we need to see the whole project.
In case you don't know, to attach a file click on "Post Reply" below, then on the next screen click "Manage Attachments"
1 Attachment(s)
Re: out of stack space/ over my head
Thank you Si, I cannot tell you how much your help/encouragement and this forum as a whole has been to me as a beginner. I am amazed at how much I have learned but I think to track this problem down now would take me a year long class :o
Re: out of stack space/ over my head
GoToTX calls Main. Main calls GoToTX.
Without looking any harder I'd guess that's it.
Re: out of stack space/ over my head
Re: out of stack space/ over my head
:o
big oops Dil...told you I was a real novice! A call to a execute a procedure will automatically return to the code that called it of course. A call from a call is the recursive loop problem!
will try to fix it and see what happens.
thank you again!!!:thumb: