Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Out of stack space" !?
#1
I got this error message when I move the character in the game I'm making... What must I do to not have this error msg? Please help me!
EEL THE BEAT OF EURODANCE!!! Smile
Reply
#2
I had this error a couple of times.

It is NOT trappable (if the error occurs you can not prevent the msg).

It could either be:
1. You have too many nested functions and/or subs.

2. You PUSHed or POKEd too much.

If that was any help.
i]"But...it was so beautifully done"[/i]
Reply
#3
I figured what's wrong... I used a lot of goto-s like that:

Code:
DO

GetKey:
If Keyb(LeftArrow) THEN GOTO MoveChar

LOOP

/code/

MoveChar:

/code/

GOTO GetKey

Now my prog runs OK Big Grin
EEL THE BEAT OF EURODANCE!!! Smile
Reply
#4
Or it could be GOTOs, LOL

I didn't consider them cause I never use GOTOs. Sorry. Big Grin
i]"But...it was so beautifully done"[/i]
Reply
#5
A recursive SUB without a proper exit case can do it. Try this:
Code:
CLS

ME

And the trouble maker SUB Tongue
Code:
SUB ME
    ME
END SUB
Reply
#6
That'd run outta stack space in less than a sec. :lol:
Jumping Jahoolipers!
Reply
#7
Yep, which was my number 1 reason I posted, too many nested functions or subs.

That code you have will have an infinite nested sub Me, within Me, within Me, etc. So depending how fast your computer is, it will take a millisec to a couple of seconds.

Hmmm, I wonder if this is possible to do in VBA..... :rotfl:

EDIT:
For me it needs to go thought 127 of nested subs before it will crash.
i]"But...it was so beautifully done"[/i]
Reply
#8
Eurodance:
Instead of using GOTO GetKey, replace it with RETURN.
Reply
#9
Already done Smile
EEL THE BEAT OF EURODANCE!!! Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)