(10-28-2022, 05:32 PM)bplus Wrote:(10-28-2022, 03:48 AM)madscijr Wrote:(10-28-2022, 02:15 AM)vince Wrote: I like how you impose functionality on constants, truly a mad scientist
Do you mean the color values? I don't recall exactly why, I must have tried using constants and something didn't work for an unsigned long, or whatever type the rgb colors need, and it didn't work, and after deliberation, someone suggested just using a function, which worked fine. So in that case not so much a mad scientist as just needing to get it to work. But I've done much bigger kludges, the digital equivalent to duct tape & redneck tech, that would earn the title of mad scientist. These days I try to keep a low profile and stay out of trouble! ;-O
Yeah something got broke using color constants, now if you use the &H... way you need to suffix a number with _Unsigned long symbol.
eg
const white = &Hffffffff ' nope!
const white = &Hffffffff~& ' OK
Was this fixed? I just tested and point values matched
Hmm... I am sure as soon as I need to depend on it in real app, it will screw up, unless someone can confirm it was fixed.Code: (Select All)Screen _NewImage(800, 600, 32)
Const white = &HFFFFFFFF ' nope!
Const white2 = &HFFFFFFFF~& ' OK
PSet (10, 10), white
PSet (20, 20), white2
Print Point(10, 10) = Point(20, 20)
Aha, thanks. I do seem to vaguely recall seeing this being discussed a while back.
Maybe I'll convert the color functions to constants eventually, for now it works so I'll leave it as functions!
Would using constants instead of functions improve performance in QB64 or QB64PE?