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 / If statement using the NOT thingy

Author
Message
CornStalks
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 22nd Aug 2005 03:12
Well I've been around for a while, but I've never understood the way to do != in DBPro. I've heard you use not, but I don't know how to use it.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd Aug 2005 03:35
CornStalks,

You could always just simply do:



I suppose it has the same effect.


+NanoBrain+
CornStalks
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 22nd Aug 2005 03:58
Haha. Leave it to something so simple to stump me. Thanks.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Aug 2005 04:01
Dark Basic does not support NOT and XOR - only AND and OR.

TDK_Man

NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd Aug 2005 04:59 Edited at: 22nd Aug 2005 05:00
TDK,

Quote: "but I've never understood the way to do != in DBPro"


I believe he was speaking of using it in DBPro. However, I am a DBC user, and figured that <> is the same as using a NOT statement.


+NanoBrain+
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Aug 2005 06:08
NanoBrain:

Quote: "I am a DBC user, and figured that <> is the same as using a NOT statement"


Not quite. Very similar though.

Strictly speaking, <> is a Relational operator along with <, > and >= and <=, whereas NOT is a Boolean operator, along with AND, OR and XOR, though their use often overlaps.

!= literally means 'not equals' in C, so your <> suggestion was correct though.

CornStalks said
Quote: "I've heard you use not"
, and I was just pointing out that NOT isn't supported by DB - just forgot to say DB Classic because I missed the 'in DBPro' bit when I read it - sorry.

CornStalks:

In DB Pro, you could use:



... but NanoBrains' suggestion is the 'normal' way to do it.

TDK_Man

CornStalks
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 22nd Aug 2005 06:12
I see. Thanks everybody.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd Aug 2005 08:27
TDK,

Good explainations.


+NanoBrain+
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 22nd Aug 2005 17:28
Yes, "<>" is the DBpro equivalent to C++/Java's "!=".
And NOT and XOR can be used in DBpro, although NOT is bugged. It is better to use '0=' rather than 'NOT':
http://forum.thegamecreators.com/?m=forum_view&t=58028&b=15

-Xol


DBpro IonRay IDE: Demo 0.1.0.0 available!

Login to post a reply

Server time is: 2024-11-27 18:47:13
Your offset time is: 2024-11-27 18:47:13