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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Arbitrary CONST values Unseen Machine 31 2,973 10-29-2025, 05:44 AM
Last Post: bplus
  VS Code and Qb64 pe Unseen Machine 6 754 09-03-2025, 09:42 PM
Last Post: grymmjack
  has anyone had ChatGPT write QB64 code yet? madscijr 13 2,990 08-23-2025, 09:15 AM
Last Post: doppler
  liquid code experiment madscijr 3 510 06-20-2025, 07:26 PM
Last Post: madscijr
  [split] Lines of Code bplus 20 3,124 01-25-2025, 05:11 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)