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.

Newcomers DBPro Corner / "Could not close nest"(highlighted at Return)

Author
Message
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 16th Jul 2010 22:59 Edited at: 18th Jul 2010 03:07
Ok so I thought I would give make a simple text battle thing a try. But when I try to run what I wrote it keeps saying " Could not close next at line 305" 305 is the last line BTW. This is what I have written. I based it on this Code Snippet called Text Battle RPG or something in the Code Snippet forum.
-----------------------------------------

------------------------------
How do I fix this?

[MODEDIT - Well, firstly, you use code tags around your code ...]
BTW I made the changes but the I attack. I think the keystate isnt working.

How do I fix this?
Ok I fixed it. Thank all of you guys. There were some serious bugs in my code.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jul 2010 14:47
you have a do - loop inside a do - loop...

Rawwrr. Sig Fail.
Newcastle is awesome
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 17th Jul 2010 14:53 Edited at: 17th Jul 2010 14:53
Hi, you forgot to close your if statement with an 'Endif' command in you shield subroutine.

Edit - Grammar and spelling

A clever person solves a problem, a wise person avoids it - Albert Einstein
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2010 15:08
Quote: "you have a do - loop inside a do - loop"

Which is perfectly OK.

@Eminent,
Your indentation is great until the end of the 'Armor' subroutine, but then you appear to do something strange with it. If you sort out your indentation, then you'll find that you're missing 'endif's all over the place.

For example, there are many missing in the 'Charge' subroutine, and 'YourHealth' should have 6 of them, but there are actually none.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jul 2010 15:51
Quote: "Which is perfectly OK."


No worries, I'm aware of that.

I just saw no way that it would ever come out of that second loop.

Rawwrr. Sig Fail.
Newcastle is awesome
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 17th Jul 2010 20:44
Thanks guy. Yeah I fixed the endifs after I posted. But I missed the one in "Shield".

Login to post a reply

Server time is: 2024-11-24 13:34:13
Your offset time is: 2024-11-24 13:34:13