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 / Operators Question...

Author
Message
Sharlenwar
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 26th Feb 2011 15:59
I keep running in to this and it might seem like a n00by question. What does something like:

if a <> 0 then somecodehere

In my head I read it as: "If A is not 0, then execute the code." So this would be useful for any input commands, such as when a player presses a key, then this code will run?

Thanks for the help!

Oh, and if there is a list of the full operators somewhere, point me in the right direction.

Thanks!

T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 26th Feb 2011 16:19
in your darkbasic editor: press F1 --> principles --> operators

all kind of operators you can find there.

hope that helps!
Sharlenwar
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 27th Feb 2011 05:15
Yeah, checked that. There isn't anywhere that explains what "<>" does. No matter, I'll figure it all out as I go here. Been working on a game which I'll post the code for as soon as I got something operating as it should.

Thanks.

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 27th Feb 2011 05:38
Operators work on a combination principle. They can be combined, and if any one of them is true, the check will pass.

This is why things like IF 5=>2 and IF 5 <> 2 pass, because in each case the second operator of the two being used in combination is true.

Not every combination is listed in the help file, to be sure, but any combination is allowed and will work in an "or" fashion.
Sharlenwar
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 27th Feb 2011 06:32 Edited at: 27th Feb 2011 12:20
Okay, that is awesome. Thanks for that insight. That explains a lot then.

As far as a list of operators, I found them in here:

http://www.madladdesigns.co.uk/extras/DBProGuide.pdf

Login to post a reply

Server time is: 2024-11-16 19:10:30
Your offset time is: 2024-11-16 19:10:30