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 / DBP - Test for inequality

Author
Message
Captain GerBear
18
Years of Service
User Offline
Joined: 9th Jul 2006
Location:
Posted: 26th Jul 2006 05:36
Hey guys. I'm just looking for the syntax for checking for inequality. I want an event to occur in every instance except when it's equal.

IF MyVar != 0 THEN: DO STUFF


only " != " doesn't seem to check for inequality in DBP. What should I be using instead?
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 26th Jul 2006 10:24
if myvar <> 0 then print "myvar doesnt equal 0!"

That should help (It's too short to bother putting in a code snippet)

The end is near
19
Years of Service
User Offline
Joined: 19th Jun 2005
Location: USA
Posted: 26th Jul 2006 12:31
only a C\C++ user would know != !!!!

My current saveings for the PS3 is: $476.00 out of $600 !!!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 26th Jul 2006 15:16
@DB User: That doesn't allow for testing against strings and other forms of data types

@The End: Tonnes of languages use boolean ops, even JS.

@GerBear:



From what I remember (been a while since I've used it) you need each condition inside of an if statement. I think I've done it using an exclamation mark I just cant remember how.


Projects: Online CTF Game | Newcommer's Guide to FPS's
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 27th Jul 2006 00:13
Quote: "That doesn't allow for testing against strings and other forms of data types"


Yes it does. Works on strings just fine in DBPro.


I had no idea there was a NOT Command!

Captain GerBear
18
Years of Service
User Offline
Joined: 9th Jul 2006
Location:
Posted: 27th Jul 2006 18:16 Edited at: 27th Jul 2006 18:57
Thanks for the help. I'd actually tried the NOT command like that, but I didn't know about using brackets, and additionally I was using them with an AND command so I didn't know if that would mess it up.
For instance, I have



Which doesn't work at all.

However, since I'm doing all of my calculation routines with variables, I think the <> operator will work just fine. THanks a lot!
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 28th Jul 2006 11:29
Just a little string example:


Ruccus: This is meant to be a joke, so please don't take it the wrong way!

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001

Login to post a reply

Server time is: 2024-11-26 14:27:57
Your offset time is: 2024-11-26 14:27:57