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 U7.7 RC6] Hexadecimals don't work right in IF statements

Author
Message
Admiral MH
13
Years of Service
User Offline
Joined: 10th Feb 2011
Location: TX, USA
Posted: 23rd Mar 2011 21:29
Here is the example code.



As you can see 0x01 + 0x01 works but not 0x01||0x02.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2011 18:47
That looks odd at first sight. However I suspect the problem is that DBPro is doing bitwise operations before returning results as integers - and it isn't obvious which operation is done first.

For example, you have



which confusingly DOES print.

If you need to do that sort of thing then it's probably better to write



which tells DBPro which operation to do first and works as you'd expect.

Incidentally, your snippet would have been easier to follow if you'd labelled the print statements. For example,



I'm sure IanM can clarify what precisely is going on in your example.
Admiral MH
13
Years of Service
User Offline
Joined: 10th Feb 2011
Location: TX, USA
Posted: 24th Mar 2011 20:55
At least it works with parentheses, though it should work without them. I think what you suspect is correct.

Quote: "Incidentally, your snippet would have been easier to follow if you'd labelled the print statements. For example,"


Yeah, after looking at my example I should have wrote it better, sorry about that.

Login to post a reply

Server time is: 2024-04-24 23:10:47
Your offset time is: 2024-04-24 23:10:47