Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB664PE v3.10.0 is now live for X-Mas!!
#51
(12-29-2023, 08:53 PM)bert22306 Wrote:
(12-29-2023, 09:16 AM)SMcNeill Wrote: Damn! Thing is, I always use hex the way you had "always assumed." Always hex number unsigned. I guess, no huge big deal, it's going to take some trial and error to see what old programs of mine will break. I guess I never ran into the problem in my Qbasic days.

Wait. If I do x = Val("&h" + "ffff")

Will I still get x = 65535

It will, but honestly, it probably shouldn't.  LOL!

This is *ONLY* changing CONST and the internal evaluations that we do with it.  

From what you've posted, it appears that VAL is probably also broken -- unless QB45 was just weird in that aspect and decided that the VAL of a hex number should always return unsigned, even if the number was stored in a signed variable.

Code: (Select All)
DIM h AS INTEGER
h = -1
PRINT VAL("&H" + HEX$(h))

Prints 65535.




Anyone got a handy version of QB45 up and running to test and see what VAL("&HFFFF") prints in it?  Is it odd, or are we missing compatibility here too, like we were with CONST?
Reply


Messages In This Thread
RE: QB664PE v3.10.0 is now live for X-Mas!! - by SMcNeill - 12-30-2023, 12:15 AM



Users browsing this thread: 1 Guest(s)