01-07-2024, 06:28 PM
(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.
GuiTools, Blankers & other Projects:
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23