QB664PE v3.10.0 is now live for X-Mas!! - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: Announcements (https://qb64phoenix.com/forum/forumdisplay.php?fid=18) +--- Thread: QB664PE v3.10.0 is now live for X-Mas!! (/showthread.php?tid=2262) |
RE: QB664PE v3.10.0 is now live for X-Mas!! - JRace - 12-23-2023 No, but... But I... That's not... Curses, they're onto me! RE: QB664PE v3.10.0 is now live for X-Mas!! - Jack - 12-23-2023 (12-23-2023, 12:52 AM)SMcNeill Wrote: Ha! You can *say* that, but we all know the real reason you're here! It's the same as everyone else's -- it's 'cause Steve is Awesome-and-Sexy, and the whole world has a crush on him and wants to be where he's at! Since I, the Awesome Steve, is here, logic only dictates that THAT is why you -- and everyone else -- wants to be here as well!!there's a grain of truth in your braggadocious statement a successful community and project ( QB64pe ) need an active leader RE: QB664PE v3.10.0 is now live for X-Mas!! - mdijkens - 12-27-2023 Code: (Select All) Const CONST_BLUE = &HFF0000FF RE: QB664PE v3.10.0 is now live for X-Mas!! - SMcNeill - 12-27-2023 That's.... just a weee off. RE: QB664PE v3.10.0 is now live for X-Mas!! - RhoSigma - 12-27-2023 (12-27-2023, 01:19 PM)SMcNeill Wrote: It's implicit sign extension. If the highest bit in the hex variable is set, one should always EXPLICITLY tell the datatype by using type suffixes. The following works... Code: (Select All)
and this too... Code: (Select All)
by the way, 32-bit colors should be unsigned values anyways, it's explicitly mentiond in the wiki in several places regarding image/color usage. Wish people would just once look there befor complaining, its rather sucking to maintain the wiki and knowing nobody use it when needed. RE: QB664PE v3.10.0 is now live for X-Mas!! - SMcNeill - 12-27-2023 In this case, it doesn't appear to be CONST itself that's off, but something more internal, which we're just seeing via CONST here. For hex values, CONST doesn't try to interpret the best value for us when calculating the number; it just assigns it to an _UNSIGNED _INTEGER64 -- which should hold the largest hex values that we push it, with no problems. The problem is, at that internal step, the value is now getting corrupted: Code: (Select All)
Quote:FFFFFFFFFFFFFFFF Those aren't the same two values at all! RE: QB664PE v3.10.0 is now live for X-Mas!! - mdijkens - 12-27-2023 (12-27-2023, 01:35 PM)RhoSigma Wrote: It's implicit sign extension. If the highest bit in the hex variable is set, one should always EXPLICITLY tell the datatype by using type suffixes. The following works...You might be totally right, but it breaks 10 years of QB64 code that always accepted Code: (Select All) Const BLUE = &hFF0000FF RE: QB664PE v3.10.0 is now live for X-Mas!! - RhoSigma - 12-27-2023 (12-27-2023, 04:32 PM)mdijkens Wrote:(12-27-2023, 01:35 PM)RhoSigma Wrote: It's implicit sign extension. If the highest bit in the hex variable is set, one should always EXPLICITLY tell the datatype by using type suffixes. The following works...You might be totally right, but it breaks 10 years of QB64 code that always accepted Oh, there's no problem accepting the Const BLUE = &HFF0000FF, it always did and will continue to do so, but it can't know what's in the programmers mind. Just by calling your const "BLUE", const can't know it shall be a color value which needs to be treated as unsigned number, for const it's still just some number, only the programmer knows what it is intended for and should code it that way. All that brings me once again back to RhoSigma's zero'th law of coding: If you want/need a certain state or behavior, than define it in your code as clear as possible using all capabilities available in the used programming language. Never depend or even worse assume any default behavior. Unfortunatly many coders do not, cause it offten includes a lot more keypresses, such as using type suffixes, declaring variables, using long unambigious variable names and so on. RE: QB664PE v3.10.0 is now live for X-Mas!! - SMcNeill - 12-27-2023 There's a glitch in there somewhere. It's not just an issue of type casting; it's tossing out incorrect values as it's evaluating incorrect input from the get go. Now WHY it's doing that is still a mystery at the moment, but we're digging into it. RE: QB664PE v3.10.0 is now live for X-Mas!! - James D Jarvis - 12-27-2023 Hope this helps, directly assigned hex values under 16 bits are fine... but go over and it blows up. But the math still functions correctly when you go over 16 bits. Code: (Select All)
|