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 / Troubles with NOT!

Author
Message
Enerzeal
13
Years of Service
User Offline
Joined: 20th Sep 2011
Location:
Posted: 20th Sep 2011 21:54


There is the code, basically to my fledgling eyes this looks correct. But as you can see from running it, it doesn't work as intended.

Can anyone talk me through it? Its really boggling my mind!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 21st Sep 2011 02:23
The boolean operator (not b) is performed before the relational operater b = 1. Since b = 2, (not b) is false and 1 is true, so therefore (false = true) = false. Put parentheses around the relational operator (b = 1), since b does not equal 1 this become false. Therefore (not false) equals true.
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 21st Sep 2011 10:27
Why not writing 'a<>1' there? Is there a difference?

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%

Login to post a reply

Server time is: 2024-11-24 01:58:51
Your offset time is: 2024-11-24 01:58:51