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 Discussion / If commands

Author
Message
Kwiki Mart
21
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 28th Dec 2003 20:07
I need to have a few if conditions in my program to be true before the then command.

My command needs to state:
If shoot=1 and image=3 and bul=0 Then.......
but I can't have 2 and commands any ideas?

On target, On time!
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 28th Dec 2003 20:23
you can have 2 and commands, but if you don't want to just put then inside each other:
if shoot=1
if image=3
if bul=0
do_stuff()
endif
endif
endif

the function "do_stuff()" won't be performed unless shoot=1 and image=3 and bul=0


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 28th Dec 2003 21:53
you can have as many as you want, as far as i have seen, i am use 3 or 4 for my buttons

Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Dec 2003 22:41
I have tons of "and" commands in one if...then. Some of my if...then commands get really crazy, like this:



The possibilities are endless, but it all works as long as you use parentheses sometimes...

Xander - Bolt Software

Don't pat yourself on the back too often, you might hurt yourself
Kwiki Mart
21
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 28th Dec 2003 23:00
@ Red_eye Thanks that worked for me

On target, On time!
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 29th Dec 2003 06:05
The only reason I can see for splitting up conditions...

... is if your current line of code has exceeded the 255 character limit. I've had to do this quite a few times in SkyCars for the very conditional, tree-like collision tests.

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 29th Dec 2003 07:17
i hate the 255char kunut

Login to post a reply

Server time is: 2025-05-22 06:04:35
Your offset time is: 2025-05-22 06:04:35