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 / Ugh, forgot an endif or next somewhere

Author
Message
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 23rd May 2009 08:31
I've spent a few hours tinkering around with this 2d game engine and now I can't get it to run. I'm missing an endif somewhere and it won't compile, and after 45 minutes I can't find the damn thing.

I checked the debug, and it looks like it cut out after the gosub RESETCURSORPOS, but there's nothing in that section of code. 216 is the position of the loop, it would be great help if the compiler could somehow find the if statement without it's buddy endif.



I've been looking for over an hour. My eyes hurt and I'm going to bed. If you see the open if statement please tell me where! Thanks.


bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 23rd May 2009 15:20
i've looked a little bit. maybe its this line of code? i can;t find its buddy...



i mean the "if LOAD1=2". and if it isn't that, you could always delete the RESETCURSORPOS label, and check if that helps...

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd May 2009 16:13 Edited at: 23rd May 2009 16:15
Edit: Nvm, I think you've got it.



IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2009 16:52 Edited at: 23rd May 2009 16:52
It looks like the indentation has gone a little off-track there somewhere.

My advice for the future is to always write both the start and the end of the section of code, before filling in the middle. Basically, after coding the if, put the endif in too. Do the same with do/loop, while/endwhile etc.

Also, if moving or copying code around, as soon as you paste, correct the level of indentation of the new code.

Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 23rd May 2009 18:28
It fixed that immediate problem, thanks!

Yeah I suck at indentation. And I usually add an endif/next/until whenever I add their precedent, but this time, I blame not sleeping.

Thanks all.

Login to post a reply

Server time is: 2024-11-24 06:55:05
Your offset time is: 2024-11-24 06:55:05