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
ryansobol
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 1st Jul 2003 03:15
Hey y'all. What is the deal with the NOT in DBPRO? I know I must be doing something wrong because a language without a NOT is pretty limiting. Im trying to do something of the like this. :-s
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st Jul 2003 03:25 Edited at: 1st Jul 2003 03:34
That my friend is C, or C++ operator usage. You need to use the <> operator.

I.e. IF (SCREEN WIDTH() <> 1024) AND (SCREEN HEIGHT() <> 768) AND SCREEN DEPTH() <> 32)
EXIT PROMPT "Sorry, but you graphics card does not support the resolution of 1024 X 768 X 32.", "Warning"
END
ENDIF

Or if you're actually testing against TRUE / FALSE conditions, use

IF NOT (SCREEN WIDTH() = 1024) AND NOT (SCREEN HEIGHT() = 768) AND NOT (SCREEN DEPTH() = 32)
EXIT PROMPT "Sorry, but you graphics card does not support the resolution of 1024 X 768 X 32.", "Warning"
END
ENDIF

Although the latter is not a very proper way of condition testing as it just complicates the code reading issue for other programmers. The former method should work though

MSI/AMD Athlon 1300, 256Mb, 60GbHD, SoundBlaster Live!, GeForce 4 MX440-64Mb, Win2K, DX9, DarkBASIC Pro(PUv4.1)
ryansobol
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 1st Jul 2003 03:55
Thanx for your speedy responce, APEXnow.

APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 1st Jul 2003 03:56
Nah prob

MSI/AMD Athlon 1300, 256Mb, 60GbHD, SoundBlaster Live!, GeForce 4 MX440-64Mb, Win2K, DX9, DarkBASIC Pro(PUv4.1)
Darkheart
23
Years of Service
User Offline
Joined: 2nd May 2003
Location:
Posted: 1st Jul 2003 04:37 Edited at: 1st Jul 2003 13:14
.

Bloodshot
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 1st Jul 2003 05:52 Edited at: 1st Jul 2003 17:51
Ummm...DBPro does have "NOT"!

Look down the page, under Principles>>Operators in the Help Assistant:

Quote: "
The NOT operator works using the following table. This operator is a unary operator and only requires a single right-side value:

NOT 0 = 1
NOT 1 = 0

"





I've always stuck with <> myself though, because I find it easier to get my head 'round, than NOT.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Jul 2003 15:14
Its slightly different to the C/C++ as it takes a left-hand and right-hand value...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Jul 2003 20:13
not really any different...





same command really just a different operator ... i have a feeling that Lee just did a check to see if there was a value on the left or not

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Jul 2003 20:29
C only takes one parameter for NOT to produce a result, while DBPro requires 2.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jul 2003 20:33
NOT just seems to toggle the bits - just like XOR does, or at least, I've not spotted the difference yet
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 1st Jul 2003 22:38
NOT only needs one parameter. I'm always using:

if not object exist(num)
endif

love it!

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 2nd Jul 2003 02:57
i dunno i've noticed that you can use it without a secondary setting and it then just checks on a boolean scale rather than a per bit or total statement.

though to be honest i would love for dbp to actually have the full array of operators at its disposal, everything seems to just be wrapped to C rather than be native. probably isn't but seems like it

Login to post a reply

Server time is: 2026-07-17 13:59:11
Your offset time is: 2026-07-17 13:59:11