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 436

Author
Message
coachsmithdhs
15
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 12th Oct 2010 19:58
I am getting this error with the following code. However, Line 436 is beyond the end of the code for the program. Any help is appricated.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Oct 2010 22:28
I just went through it all and couldn't find an unclosed nest. Why do you have colon before every remark? Well remarked by the way, to the point of excessiveness!!

I tcould be that putting a colon after an "if blah=blah" statement is causing it to be treated like an "if blah=blah then" statement?

Without media it's hard to test, and next time put your code in a...


coachsmithdhs
15
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 13th Oct 2010 04:28
Thanks for your help- I will try that.

Also, sorry about the code, this was my first post on here so I wasn't sure how to do it.

Thanks again, Caleb
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Oct 2010 10:50
You've got a DO without the LOOP. Add a LOOP to line 341 (a bit before the EndSection label).

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Oct 2010 11:17
Well spotted Grog, missed that one!

coachsmithdhs
15
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 13th Oct 2010 16:11
Thank you, Grog! I appreciate it. I'm a beginner to Dark Basic and programming all together so I spend hours trying to fix something like that.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Oct 2010 19:32
Thank you both.

There are several IDEs that automatically close any loop. Check the ability on and you won't accidentally forget to close a DO/LOOP, FOR/NEXT, REPEAT/UNTIL, WHILE/ENDWHILE, and FUNCTION/ENDFUNCTION.

Indigo (Tools - Options - Text Editor - Auto Complete Loops)

BlueIDE (Tools - IDE Options - Text Editor - Auto Complete Loops)

EditorU75.exe (Tools - Options - Text Editor - Automatically Insert Closing Block Statement)

EditorNew.exe (Tools - Options - Text Editor - Automatically Insert Closing Block Statement)

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Oct 2010 17:48
Quote: "Check the ability on and you won't accidentally forget to close a DO/LOOP"


It's a matter of personal taste really - if I use that option then I invariably close the nest myself so it gets closed twice which gives another compiler error.

I prefer to enter the code I want not what an editor thinks I want - same applies to the autocomplete/autocorrect functions in Word and Excel and other packages.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Oct 2010 18:07
Me too GG I turned it on once and I just got annoyed!

It's better that you get used to closing your own loops anyway I think, it makes you more methodical. It's like automatic wind-screen wipers, is having a lever two inches from your hand too much for people to deal with?

...I'll stop myself there!

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Oct 2010 19:40
Yeah I keep that off on mine too. It's better to learn to remember to close all loops rather than have the program do it for you. Always keep it on and you'll never learn.

=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 16th Oct 2010 21:07
I always type



and then put whatever code needs to be put inside the loop. I do the same thing with style tags on this forum as well; and no doubt countless other things

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Oct 2010 22:14
Quote: "and then put whatever code needs to be put inside the loop"


I've tried that but I still forget that the closing command is already there - especially if I'm coding during the witching hour.

Login to post a reply

Server time is: 2026-07-23 10:30:40
Your offset time is: 2026-07-23 10:30:40