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 / Problem w/ If/Endif

Author
Message
H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 27th Dec 2005 19:37
Hello. I'm new to Darkbasic, I just got DarkBASIC Pro Online for christmas, but I have been programming in other basics for several years. I'm having trouble with one of my first programs, I keep getting an error message saying "Command out of place at line 59," which is an endif statement, when I try to compile it. What confuses me more is that if I comment out the endif, it still works, despite there being no endif statement at all.

Here is the function from my code(in its newb simplicity). It is a funtion to control falling onto the ground, and sometime also jumping:
Flaming Ghost
19
Years of Service
User Offline
Joined: 29th Apr 2005
Location: Um...Right here
Posted: 28th Dec 2005 02:56
Error Obtaining Source. Just Type your source in the message Box Instead of the Code Box.

Am I dead yet?
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 28th Dec 2005 03:04 Edited at: 28th Dec 2005 03:07
sounds like u have an extra endif not nestled in a loop
if u have a for next loop make sure there all closed.
same with do loop, while end, repeat until....ect.

And cant obtain code, so this is best i can suggest at this time.

crighton



****edit***
just had a thought,
If ur using...

then u dont need an endif, this will cuase the error aswell.

aye!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Dec 2005 03:42
Quote: "Error Obtaining Source. Just Type your source in the message Box Instead of the Code Box."


With code snips.

[ code ]
Your code here.
[ /code ]

Just remove the spaces between the brackets and we see this:




H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 28th Dec 2005 23:55
Oop, sorry about that.
Here is what my code was:



Actually, though, I was able to get around it, but thanks all for responding to my question.
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 29th Dec 2005 06:54
kinda... pointless

santah my god, theyre real! *santa faints*
red m&m:oh my god, hes real!*m&m faints*
H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 6th Jan 2006 00:59
Okay, I just realized what it was
Apparently DarkBASIC doesn't completely ignore the REM statements, because having the "..." on the end of the line was what was causing this problem.

Login to post a reply

Server time is: 2024-09-24 11:26:20
Your offset time is: 2024-09-24 11:26:20