Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Stack Overflow Error? x.x

Author
Message
gh0u1
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 27th Apr 2004 03:51
Ugh. I'm feeling terribly n00bish, but I've come across an error I don't think I've ever met before. A 'stack overflow' error, or something of the sort. Everything else works fine, I'd just really appreciate it if someone could point out the problem to me. Thanks a ton, everyone, especially for putting up with n00bs like me.
gh0u1
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 27th Apr 2004 06:07
... hello? Anyone there? If it's a stupid mistake, you could just tell me.
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 27th Apr 2004 08:17
I think it is the way your program runs. It is bad to goto a sub then goto another sub from in that sub. It keeps pilling stuff on the stack. If it works like QBASIC that is. Try changing them to goto instead of gosub and see if that helps. That would be a easy fix but to do it right I think you need to break them down into smaller subs that always returns to where it jumped from. Or you can use functions. But I'm sort of a newbie myself. When I started programming to always return from a sub I stopped getting that error.

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
gh0u1
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 27th Apr 2004 21:47
That's what I was thinking, or something along that line, but the definition of goto where it says 'cannot return' has always intimidated me... I'll give it a try anyway. Thanks!
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 28th Apr 2004 01:12
It is best to stay away from goto for sure. You just need to break down your subs so that every gosub always has a return.

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Apr 2004 22:49
check you're other post, I replied to the problem there.

"eureka" - Archimedes

Login to post a reply

Server time is: 2025-05-23 11:47:41
Your offset time is: 2025-05-23 11:47:41