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.

Author
Message
Dark Basic pro error
13
Years of Service
User Offline
Joined: 2nd May 2013
Location:
Posted: 2nd May 2013 01:31
Hi ,
There is an error in my game with DB pro:
"Could not close nest at line 23"
This is my source-code:

Thank for your help!
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 2nd May 2013 02:50
It should be like this:


Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 2nd May 2013 02:53 Edited at: 2nd May 2013 02:54
There is no "else if" in DBP, you'll have to nest if-clauses within else's yourself. As such what you have there could be rewritten as


I don't know if you're new to programming but if you are I would recommend using a switch clause (which for whatever reason is called select in DarkBASIC by the way) for the kind of thing you are doing there.
You would use it like so:



"Why do programmers get Halloween and Christmas mixed up?"
Dark Basic pro error
13
Years of Service
User Offline
Joined: 2nd May 2013
Location:
Posted: 2nd May 2013 11:33
Thank you very much!

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd May 2013 12:05
I'm not arguing, but I'm not sure what your question ... your question or your name ...you should find a more appropriate name

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd May 2013 13:14
There's been a few people choosing daft names like that recently. Perhaps there ought to be a procedure for moderating new user names as well as their posts?

But then there just might be someone in the world whose name is "Why doesn't my program work".

Login to post a reply

Server time is: 2026-07-06 20:30:06
Your offset time is: 2026-07-06 20:30:06