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
J4CKB0Y
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location: Llay,Wrexham,Wales
Posted: 1st Nov 2013 00:11 Edited at: 3rd Nov 2013 23:34
I played my game, took a break then played it again, but when I went to play it again it stated:

Could not close nest at line 106

Every time I deleted a line of code the error changed from 106 to the last line and if the last line is a "Rem" Command it will change to the line after "Rem" even if it doesn't exist!
I copyed and pasted the code to a new file in case the old file was corrupted, the error remained!

Here's the code:



(EDIT 1) Ignore the Useless "Goto's" before I die of laughter!

Jack the human
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Nov 2013 03:19
You might be missing an endfunction or an endif somewhere where you last editing the source code.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Nov 2013 07:04
Indent your code and you'll probably find it

Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 1st Nov 2013 10:59
In intro:, your first conditional statement is just "IF SM$"

There is no THEN following it, or corresponding ENDIF that I could see

Also, SM$ is a string variable, so you might want it to read IF SM$ = "ON"

But yeah, like phaelax said, indenting makes finding these sort of errors waaaay easier

This is not the Sig you are looking for....
J4CKB0Y
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location: Llay,Wrexham,Wales
Posted: 1st Nov 2013 11:59
It was just the missing bit of code at the intro, thanks for pointing that out.

Jack the human
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Nov 2013 15:28
And please for the love of god and all that is holy, STOP using GOTO's!

Especially things like this...


Why do this?? Why not just do this...


Please don't! Just, simply don't!

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 2nd Nov 2013 20:58 Edited at: 2nd Nov 2013 21:16


Wow, JUST WOW; those two lines made me laugh so hard I am crying. Did you miss out a few lines when copying and pasting or do you really want to tell the program to go to the next line?

No disrespect, but after some more practice and experience you will understand why GOTO is not required or desirable for these solutions.

J4CKB0Y
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location: Llay,Wrexham,Wales
Posted: 3rd Nov 2013 23:32
*Reads Code Snippet*



*Explodes with laughter *

Yeah I'm going to edit my program before I die from laughter...

*Dies from laughter *

Jack the human

Login to post a reply

Server time is: 2026-07-06 10:40:08
Your offset time is: 2026-07-06 10:40:08