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.

DarkBASIC Professional Discussion / simple boolean logic error

Author
Message
BHoltzman
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 30th Sep 2002 11:43
I tried this code:

a as boolean
a = 1
if abs(not a) = 1
print "not a = 1 ,"; abs(not a)
else
print "not a = 0 ,"; abs(not a)
endif

a = 0

if abs(not a) = 1
print "not a = 1 ,"; abs(not a)
else
print "not a = 0 ,"; abs(not a)
endif

wait mouse


and the output was
not a = 1 ,1
not a = 1 ,1

Not what I expected. The not operator returns a negative 1 for a, so I had to use the abs() function.

I wanted to use DBPro for my homework assignment by testing out boolean expressions for equivelancies but I guess I'm not going to be able to.

My suggestion is "take your time with patch 2. Get it right before you release it. DBPro needs to be useable and reliable for me to even consider using it for anything remotely important."
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 30th Sep 2002 14:15
Unfortunately, there does seem to be a problem with the NOT command - this has been mentioned elsewhere before...

Hopefully, it will be sorted in the next patch...

And yes, I agree that patch 2 should be got right before being released...

Yes, I really am THAT good...

Login to post a reply

Server time is: 2024-04-25 15:04:12
Your offset time is: 2024-04-25 15:04:12