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.

Bug Reports / DBPro BOOLEAN is BYTE

Author
Message
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 19th Apr 2012 13:23
Boolean Variable definition seems to give me a byte, try this:



I get :



Should be :



"Don`t try to engage my enthusiasm, I don`t have one"
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Apr 2012 13:39
It's not a bug - but isn't very helpful I agree. The NOT operator works bitwise which is why you get 254.

Just use



instead.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 20th Apr 2012 16:27
Thanks, I pretty much assumed that.
I know from experience that a bit/byte/word makes little difference when we are working with a 32 or 64 bit CPU anyway, and probably takes longer to simulate.

Incidentally you can get it to act more like a bit by ANDing with 1 every time you address it IE:



gives :



"Don`t try to engage my enthusiasm, I don`t have one"
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2012 01:36
Yep. But if you want boo to be always 0 or 1 I suppose you could use

Inflictive
14
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 18th May 2012 07:44
This is weird, I wasn't having this problem earlier but then I updated to 7.62 and this appeared. Messed up my program too.

I made this sample program to test it:


So boolean is treated as a byte now...

"This plan is so perfect... it's retarded."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th May 2012 13:10
Has been for a very long time.
Inflictive
14
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 19th May 2012 04:52
Well, either way, my program used to respond correctly to NOTs but now it does 1,254,1,254 instead of 1,0,1,0. So I just use "1-" in place of "NOT"

"This plan is so perfect... it's retarded."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st May 2012 18:09
That's what I do. I vaguely recall some of the logical operators were changed to work bitwise a few years ago. There's been some discussion about it over the years especially in connection with the NOT operator.

Here's one old thread on the topic:

fun with binary and logical operators in DBPro

I guess "my program" hasn't been tested with a new upgrade for some years.

[Forum connoisseurs might like to note the ghostly presence of WindowsKiller in that thread. I wonder what happened to his posts. ]
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd May 2012 20:06
The operators have always been bitwise, it's just in certain cases they behave differently:


That code only prints "B" - messed up I know, but DBPro treats "if not" as a special case and does a logical not instead.

[b]
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd May 2012 16:50
Quote: "The operators have always been bitwise, it's just in certain cases they behave differently"


I'm fairly sure one of them was changed to be bitwise since I recall Lee announcing the fact. It might have been the NOT operator. I could have imagined it though.

I'll see if I can find the relevant upgrade note and edit this post accordingly.

Login to post a reply

Server time is: 2024-04-25 10:59:44
Your offset time is: 2024-04-25 10:59:44