Bitwise Debug

Just starting out? Need help? Post your questions and find answers here.
User avatar
Piero
Addict
Addict
Posts: 1040
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Bitwise Debug

Post by Piero »

Does Debug consider ~a as ~integer?

Code: Select all

a.a = 1
Debug ~a ; -2
a = ~1
Debug  a ; 254
SMaag
Enthusiast
Enthusiast
Posts: 327
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: Bitwise Debug

Post by SMaag »

PB result is absolut correct.
.a is an ASII = unsigned Byte 0..255.
Not 1 = 254 -> correct
User avatar
mk-soft
Always Here
Always Here
Posts: 6315
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Bitwise Debug

Post by mk-soft »

Be careful. The debugger considers everything as a signet. Is unfortunately so ;(
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Piero
Addict
Addict
Posts: 1040
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Bitwise Debug

Post by Piero »

mk-soft wrote: Thu Feb 13, 2025 7:09 pm Be careful. The debugger considers everything as a signet. Is unfortunately so ;(
Thanks mk-soft! …but you didn't answer to my question ;( ;( ;(
User avatar
mk-soft
Always Here
Always Here
Posts: 6315
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Bitwise Debug

Post by mk-soft »

Piero wrote: Thu Feb 13, 2025 6:08 pm Does Debug consider ~a as ~integer?

Code: Select all

a.a = 1
Debug ~a ; -2
a = ~1
Debug  a ; 254
Yes, but for the program is an unsigned byte. It's a debugger output failure ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Bitwise Debug

Post by idle »

Code: Select all

a.a = 1
Debug Bin(~a,#PB_Ascii) ; -2
a = ~1
Debug Bin(~a,#PB_Ascii) ;
User avatar
Piero
Addict
Addict
Posts: 1040
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Bitwise Debug

Post by Piero »

Resuming:
Bitwise operations on variables in Debug always return a (signed) Byte!
Be careful!
Post Reply