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 nes. Please help me.

Author
Message
thelighgod
8
Years of Service
User Offline
Joined: 10th Oct 2015
Location:
Posted: 1st Apr 2016 15:41
This is my first fourm post and I am a bit stuck on my project. I was making an adventure game when I ran into the error of: Compilation Failed. Could not close nest at line __. It kept repeating the error.

set Dir "Textures"
Rem Main Menu

Load bitmap "MENU.BMP",0
if spacekey()=1
Load bitmap "CONTROLS.BMP",0
Wait 3000

Rem Main Game
Set text font "Chiller"
Set text size 30
Print "You walk down the pathway to a old Science lab."
Print "Do you want to enter the science lab"
if spacekey()=1
Print "You have entered..."
wait 3000

Many thanks
-Thelighgod
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Apr 2016 16:15
Welcome

You have 2 unclosed loops, this is the first:



This should be:



You must always state where the IF ends. The only time you don't is when it is all on one line like so:

IF spacekey()=1 THEN Load bitmap "CONTROLS.BMP",0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
thelighgod
8
Years of Service
User Offline
Joined: 10th Oct 2015
Location:
Posted: 1st Apr 2016 20:50
It worked
Thanks
thelighgod
8
Years of Service
User Offline
Joined: 10th Oct 2015
Location:
Posted: 1st Apr 2016 20:55
Wait I found that It crashed the game when it launched


set Dir "Textures"
Load bitmap "MENU.BMP",0
if spacekey()=1
Load bitmap "CONTROLS.BMP",0
Wait 3000
endif
Set text font "Chiller"
Set text size 30
Print "You walk down the pathway to a old Science lab."
Print "Do you want to enter the science lab"
if spacekey ()=1
Print "You have entered..."
wait 3000
endif

Please Help

Login to post a reply

Server time is: 2024-04-25 15:58:19
Your offset time is: 2024-04-25 15:58:19