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 Professional Discussion / could not close nest at line...

Author
Message
imtherealchaka
13
Years of Service
User Offline
Joined: 12th Oct 2012
Location:
Posted: 7th Jan 2013 16:52
so im having a problem ive been doing a lot of copying and pasting but i dont see any places where there is an unclosed loop and ive had a friend check it as well and they cant really find one either i was just wondering if anyone could help me and sorry that me code is so long just trying to see if you guys have found anything that i havent

sofuesh soclean
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Jan 2013 19:20 Edited at: 7th Jan 2013 19:21
Congrats, your code is worthy to be on TheDailyWTF.

When you "gosub" something, you have to use return. Example:



Your logic is completely flawed. It's very bad to call a subroutine (a gosub) inside a DO/LOOP, and then have another DO/LOOP inside that subroutine. This means that the return statement will never be reached.

You seem to be calling more and more subroutines, but never ever call return. This will eventually crash your program (stack overflow).

Having more than 1 main loop is bad practice as well.

As horrible as that code is, I was able to compile it with no problems.

TheComet

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 7th Jan 2013 19:21 Edited at: 7th Jan 2013 19:23
Change Next t to next CheckStep on line 648

Also take a look at the Do loop on line 768; where is its Loop statement?



In addition to TheComet's advice; Why do you use colons to seperate comments?

imtherealchaka
13
Years of Service
User Offline
Joined: 12th Oct 2012
Location:
Posted: 7th Jan 2013 21:52
ok first off as a reply to comet's quote
Quote: "Your logic is completely flawed."
all of my knowledge of any sort of game design has come from a computer video program at a high school and as a reply to Chris's comment
Quote: "In addition to TheComet's advice; Why do you use colons to seperate comments?"

the reason for that is a lot of this program is a pre-created by that same video program mentioned earlier

sofuesh soclean
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jan 2013 04:37
Quote: "Quote: "In addition to TheComet's advice; Why do you use colons to seperate comments?"
the reason for that is a lot of this program is a pre-created by that same video program mentioned earlier"


Just curious, that's not quite what the colon is used for.

Login to post a reply

Server time is: 2026-07-07 09:04:42
Your offset time is: 2026-07-07 09:04:42