Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upcoming changes to CONST may affect your code
#7
(12-29-2023, 05:33 PM)Kernelpanic Wrote: So, I don't really understand it anymore.  Huh

Code: (Select All)

'Const-Problem. https://qb64phoenix.com/forum/showthread...0#pid22330
'29. Dez. 2023

Const foo = 1
Print foo

Const foo1 = &HFFFF
Print foo1

Const foo2 = &HFFFF + &HFFFFFFFF
Print foo2

'Addition von Pluswerten, sonst Minuswert
Const foo3 = &HFF000000~& + &HFFFF~&
Print foo3

'4278255615 + (-65535) = 4.278.190.080
Const foo4 = &HFF000000~& + &HFFFF
Print foo4

Print
'Minuswert
Const foo5 = &HFF000000 + &HFFFF
Print foo5
Print
Print &HFF00FFFF
Print &HFEFFFFFF

[Image: Const-Problem2023-12-29.jpg]

You're still using the currently bugged version.

Quote:At the moment, there are instances where CONST will *negate* the resulting value for us. Const foo = 1 will assign a value of -1 to foo... This is a 100% glitch and is being patched even now by the dev team. (It's not something so obvious as to work with 1, but the previous was just an illustration. Where you can find the glitch is with CONST foo = &HFFFF which returns a value of - &HFFF.)


You're not going to see the changes yet, as they're still in the update queue and not live in the language yet. I was just giving folks early warning of *upcoming changes*, in the next release.

Wink
Reply


Messages In This Thread
RE: Upcoming changes to CONST may affect your code - by SMcNeill - 12-29-2023, 05:41 PM



Users browsing this thread: 19 Guest(s)