Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64 Phoenix Edition v3.11.0 Released!
#18
(01-07-2024, 06:02 PM)SMcNeill Wrote:
Code: (Select All)
Print &HFFFF
Const foo = &HFFFF
Print foo
Data &HFFFF
Read foo2
Print foo2
foo3$ = "&HFFFF"
Print Val(foo3$)

For example, the above prints:
Quote:-1
-1
65535
65535

Input and Line Input return... I dunno, but it'll be one of those two values...
GET returns... I dunno...

Every place in QB64 seems to handle these functions differently. If you want consistent results, add the suffix yourself and then you'll never need to worry about it.

Reading a value from file using INPUT #1,numvar and if the value is written as &H/&O/&B number inside the file will also result in 65535 as its mostly same logic as in DATA is used. This is as far as the given variable type is larger than the input, same is true for INPUT numvar, but here the input logic will also prevent exceeding the var type size, try INPUT a%%, compile and then try enter &FFFF and it will stop accepting more than 2 F's.
Reply


Messages In This Thread
QB64 Phoenix Edition v3.11.0 Released! - by a740g - 01-03-2024, 05:45 PM
RE: QB64 Phoenix Edition v3.11.0 Released! - by RhoSigma - 01-07-2024, 06:28 PM



Users browsing this thread: 1 Guest(s)