Out of Stack Space
Out of Stack Space
If anyone would be so kind, could someone elaborate on the Out of Stack Space error? I'm aware of what the stack is sort of but I'm afraid I don't know well enough to totally understand what this error means. Any help would be appreciated. I just want my lil' game to work properly, and not... ya know... bad.
Thanks again, you guys are great.
Dave.
Thanks again, you guys are great.
Dave.
- The Awakened
- Veteran
- Posts: 144
- Joined: Sun Aug 07, 2005 1:51 am
Basically, the stack is a memory structure that you can push variables onto and pop them off. You'd have to get into assembly to really understand how the stack works.
To fix your error, put this somewhere at the beginning of your program:
Good luck man!
To fix your error, put this somewhere at the beginning of your program:
Code: Select all
CLEAR ,,5000
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
Ehh, It's probably more likely that you've got an out of stack error because you've called too many subs withing subs... (If your a begginner)
Post up the code here and I'll explain it to you.
matt
Post up the code here and I'll explain it to you.
matt
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
- ShadowWolf
- Veteran
- Posts: 56
- Joined: Thu Mar 04, 2004 1:32 pm
- Contact:
if your using gosub ick then you might run into a stack error there.
function / subs you really shouldn't run into a stack error unless you have some kind of recursion error. i.e. calling a the same function in a loop with in that function in which it can never be resolved or runs out of stack space before the recursion can resolve it self.
function / subs you really shouldn't run into a stack error unless you have some kind of recursion error. i.e. calling a the same function in a loop with in that function in which it can never be resolved or runs out of stack space before the recursion can resolve it self.
Thanks Shadow wolf. I'm definitely not using gosub, so I guess I should be fine now. Now on to fixing some other bugs! I got one that's been stumping me for awhile now, but I'm determined to figure it out. I'm just trying to make a program that I can be proud of so I'd like to figure out as much as I can on my own rather than asking for help every time I have a little bug.
Thanks again to all you guys that helped me, I really do appreciate it.
Dave
Thanks again to all you guys that helped me, I really do appreciate it.
Dave
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
You'll come across an out of stack error if you never return from subs or gosubs... Beginners tend to write code where this happens (just because they're starting).
Eg:
Running anything structured like that will flood the stack. You can dodge it a little by making sure your stack is fork huge, but it will flood. The point is to try and learn how to structure your sub's utilising the EXIT SUB command....
If your subs are called like that, then you would need to re-jig them...
matt
Eg:
Code: Select all
'My game!!!!
Menue 'Start here
'=-=-=-=-=-=-=-
SUB menue
'blah
PRINT "would you like to play?":input A$:if A$ = "n" then end
Game
END SUB
SUB game
'blah
if int(rnd*100)<20 then FIGHT
'blah
END SUB
SUB fight
if eHp < 1 then game 'You Won!!!!!
if Hp < 1 then menue '?ou Died!!!!
END SUB
Running anything structured like that will flood the stack. You can dodge it a little by making sure your stack is fork huge, but it will flood. The point is to try and learn how to structure your sub's utilising the EXIT SUB command....
If your subs are called like that, then you would need to re-jig them...
matt
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic