Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB664PE v3.10.0 is now live for X-Mas!!
#47
(12-29-2023, 02:09 PM)Kernelpanic Wrote: The QuickBasic 4.5 manual says the following about constants:

The type constant is either explicit through the type identifier, or determined by the type of expression. Without a type identifier, the simplest type in which the constant can be represented is always assigned.

Strings are always define as string constants.

Code: (Select All)

Const Wert1 = 344 '-> Integer
Const Wert2 = 3.44 '-> Single, simplest type

'Error
'Const Stadt = Berlin

'Correct
Const Stadt = "Berlin"

Print Wert1
Print Wert2
Print Stadt

Aye, and the current issue comes from here: 

Quote:The type constant is either explicit through the type identifier, or determined by the type of expression. Without a type identifier, the simplest type in which the constant can be represented is always assigned.

In QB45, there were no unsigned variable types.
By the ruleset above, &HFFFF has no explicit type identifier. The simplest type that it can be represented in, is a SIGNED INTEGER. That's -1.
By the same ruleset, &HFFFFFFFF has no explicit type identifier. The simplest type that it can be represented in, is a SIGNED LONG. That's also a value of -1.

&HFFFF + &HFFFFFFFF = -2

Seems odd as heck to me, but that's what it is, when neither value has an explicit type identifier.

QB64 hasn't been doing this properly, and that's being fixed -- and that fix may change folks code which relied upon the improper handing of these values. You can read about (and respond to) those changes in the topic here: https://qb64phoenix.com/forum/showthread...0#pid22330

No need to keep a discussion this important on the back page, hidden dozens of replies deep, in a topic simply announcing that a new version has been released. Wink
Reply


Messages In This Thread
RE: QB664PE v3.10.0 is now live for X-Mas!! - by SMcNeill - 12-29-2023, 02:34 PM



Users browsing this thread: 1 Guest(s)