10-29-2025, 12:31 AM
(This post was last modified: 10-29-2025, 12:47 AM by ahenry3068.)
(10-28-2025, 11:30 PM)Unseen Machine Wrote: I think also I may have found a small bug...
To demonstrate :
Code: (Select All)
CONST True = 1
CONST False = NOT True '// Therefore anything not 1 = FALSE
PRINT "My false is = 0 so as False is supposed to be anything thats not true lets see if 0 = False!"
FOR i% = 0 TO 15
PRINT True, False '// Lets see if they stay the same
IF 0 = False THEN PRINT "0 = false" ELSE PRINT "0 whilst not being = true is not actually false!"
NEXT
I noticed it a while back when using flags to control gl without using a SPECIFIC True Value. Just saying True = not false, my Gl loop would run when it shouldn't...is it a bug or expected behaviour....
John
I understand your confusion but this is expected and how almost all BASIC's act.
NOT in BASIC is BITWISE not logical
1 as an int is &B0000000000000001
NOT 1 is &B1111111111111110
This is a non zero value and acts as TRUE.
Only NOT -1 ends up being 0 So TRUE should be -1
BTW: In QB64PE 4.2 _TRUE & _FALSE are already pre defined so just use those.
Try this code.
Code: (Select All)FOR I = -2 to 3
print _BIN$(NOT I)
NEXT


