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.

Author
Message
Otrebor
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 28th Sep 2003 00:40
Hi, i´m trying to adapt a QBASIC program on DARKBASIC:


IF brd(mloc) = bkg THEN
IF mloc > 7 THEN
dest = brd(mloc - 7)
IF dest = 0 AND jp = 0 THEN
nomo = nomo + 1
listm(moveptr + nomo) = mloc
listd(moveptr + nomo) = -7

ELSEIF (dest AND wman) > 0 AND mloc > 16 THEN

IF brd(mloc - 14) = 0 THEN
IF jp = 0 THEN
jp = 1
nomo = 0
ENDIF
nomo = nomo + 1
listm(moveptr + nomo) = mloc
listd(moveptr + nomo) = -14
ENDIF
ENDIF
ENDIF
ENDIF

Well, my problem is ELSEIF and the line IF...THEN without condition.
Thank´s for any help!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Sep 2003 02:03 Edited at: 28th Sep 2003 02:03
Your version:



Revised version:



No such thing as elseif in Db so lots are nested if's are the order of the day I'm afraid. There are two forms of IF (one without THEN and one with THEN)

IF condition
stuff1
stuff2
stuff3
ENDIF

IF condition THEN stuff1 : stuff2 : stuff3

This 2nd example means if condition is true THEN run all commands until end of line.

If your mansion house needs haunting, just call Rentaghost!
Otrebor
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 28th Sep 2003 02:18
THANK YOU!

Login to post a reply

Server time is: 2024-09-21 01:10:59
Your offset time is: 2024-09-21 01:10:59