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 Discussion / Nesting Error, can you help me find it?

Author
Message
LordAnki
21
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 18th Oct 2004 04:57
Okay I have a nesting error in my game. But i can't seem to find it. Can someone help me. Heres the source.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 19th Oct 2004 10:22
Your nesting error is at the end of your code. You have "select home" and then a bunch of code after that. You forgot to close of your last "case" statement with an endcase command and then the endselect command at the end of your select block. Right before your "quit" subroutine, you need to put in an "endcase" and an "endselect" command.

I also noticed some other problems with your code. You have "select home" This needs to be "select home$" since you are asking the user for a string instead of a number. Then you need to change where you have case Kitchen, Living room, etc. to have quotes, "" around each string. Example:



Hope you understand this.

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 20th Oct 2004 08:53 Edited at: 20th Oct 2004 08:53
Here you go, save and load should work!

You'll have plenty of time to live in a van down by the river, ... WHEN YOU'RE LIVING IN A VAN, DOWN BY THE RIVER.
LordAnki
21
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 20th Oct 2004 09:47 Edited at: 20th Oct 2004 09:57
yay! Thanks mattman. Once again you save me.

Edit: Okay, there is a syntax error on line 187.



That is line 187.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 21st Oct 2004 04:49
should be:



joep

Do you need a complete FPS,3rdPS engine ?? Or a collision command libary?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
LordAnki
21
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 21st Oct 2004 12:22
okay now i have another freaking nesting error. Aragh!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 22nd Oct 2004 10:49
Sorry, i didnt run it i just freehand coded it, will try it out now...

You'll have plenty of time to live in a van down by the river, ... WHEN YOU'RE LIVING IN A VAN, DOWN BY THE RIVER.
Northern Lights
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Minnesota, USA
Posted: 22nd Oct 2004 11:36
code] If upper$(answer7$)="SAVE"
if file exist(upper$(petname$) + ".dat" = 1
input "Overwrite? 1 for yes and 0 for no",overwrite
if overwrite < 0
delete file upper$(petname$) + ".dat"
Open to Write 1, upper$(petname$) + ".dat"
Write String 1,name$
Write String 1,petname$
Write Long 1,pet
Write Long 1,Str
Write Long 1,Dex
Write Long 1,Intel
Write Long 1,Cha
Write Long 1,Wis
Write Long 1,HP
Write Long 1,PetHunger
Write Long 1,Cash
Close File 1
Print "Game Saved!"
endif
if overwrite = 0
print "No save"
goto home
endif
endif
endif


try that out. Just added an extra endif.

"Watson you idiot! Someone stole our tent!"
LordAnki
21
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 22nd Oct 2004 11:50 Edited at: 22nd Oct 2004 11:53
lol thanks! All of you.

I'll be sure to put yall in the credits or w/e

Okay, I have a question. If a person were to type in something wrong then how could i make it say something like "Wrong command" or something like that. and it asks them again.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 22nd Oct 2004 12:59 Edited at: 24th Oct 2004 12:00
Just run a series of if and elses

It's kinda large and klunky, but its the best I can come up with in two minutes

You'll have plenty of time to live in a van down by the river, ... WHEN YOU'RE LIVING IN A VAN, DOWN BY THE RIVER.
Northern Lights
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Minnesota, USA
Posted: 23rd Oct 2004 01:18
I tried something else, but it got way to complex for something that simple. I think I have a VB book that does this. Maybe I can translate it over to DB.

"Watson you idiot! Someone stole our tent!"
LordAnki
21
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 23rd Oct 2004 07:51
ok,

well thanks yall. I will figure out how to implement your way if i can. And if you can figure out a way anyone thanks!

Login to post a reply

Server time is: 2025-05-24 13:07:57
Your offset time is: 2025-05-24 13:07:57