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 / DB PRO wont compile! ARG!

Author
Message
ironhoof
17
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 15th Sep 2002 08:32
I just got it in the mail today and when i try to compiel anything that looks like this it gives me the COMMAND OUT OF PLACE ERROR!????

a=1

do
if a=1 then goto pickle:
loop

pickle:

and whats strange is the fact that THIS! dose not give me that error

a=1

do
goto pickle:
loop

pickle:


dose DO and LOOP have something against IF's???? NO infact you cannot combine GOTO with IF in a loop for some reason OR in an IF ENDIF or a WHILE ENDWHILE or REAPEAT.. so on if you combine IF wiht GOTO in any of those it will cause an error whats with that!! sometimes its nessessary to combine IF's in the loops!

can i shutoff the rror checking for that?
Capricorn
17
Years of Service
User Offline
Joined: 30th Aug 2002
Location: - Please Select -
Posted: 15th Sep 2002 10:11
if a=1 then goto pickle:

Remove the colon. It shouldn't be there

Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 15th Sep 2002 11:59
Zippy is right, remove the colon and all will be well.

The reason you're getting "command out of place" is because the compiler thinks you're trying to put a code block (labelled with "pickle") inside an IF statement which is totally invalid.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Ian T
17
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 15th Sep 2002 17:54
Remember, GoSubs are the future, not Gotos... .

--Mouse

Login to post a reply

Server time is: 2020-08-04 03:33:21
Your offset time is: 2020-08-04 03:33:21