12-20-2025, 02:09 AM
(12-19-2025, 11:57 PM)SMcNeill Wrote:(12-19-2025, 10:27 PM)Unseen Machine Wrote: I love that it never goes more than 2 layers deep! Linus (the man who made linux and GitHub) would be pleased!
Now, forgive me for being dictatorish but
CONST CLR_RED& = _RGB32(255,0,255) ' //etc with yellow black ....
Then ONE sub can handle it all by you sending the const
SUB Set_Color (CLRFlag&)
AND joyously you can then stick it in a .bi (consts) and a .bm (the sub) and use it in any programme in the future and by adding more consts you can have as many colours as you want!
John
Your solution seems like a lot more work to me, John.
I'm personally a lazy coder, and have bad knuckles. Conserving keystrokes is important to me to reduce stress on my joints. Too much stretching and typing and clicking, and it's time for me to take a break, take something for inflammation, and come back later.
This is the original:
Code: (Select All)
Print " By the way, an ";: Yellow: Print "Easter Egg";: White: Print " with the best recorded solutions for all of the"
And with your solution, this same code would be:
Code: (Select All)
Print " By the way, an ";: Set_Color Yellow: Print "Easter Egg";: Set_Color White: Print " with the best recorded solutions for all of the"
That's a good bit of unnecessary extra typing there. In a program with a crap load of color changes, used as this is intended to be used? I'd just do like this -- define a quick sub with the chosen color and have it set it, and be done with it.
Added bonus? No need for a *.bi or *.bm file. You can share the entire code, as is, on the forums for others to test, without needing to download anything, copy/paste from download folders, clean up stray *.bm files afterwards... Just one code box, all the code inside, and done.
PS: You don't need to define a ton of colors usually. You do know we have a $COLOR metacommand now, that loads a whole boatload of predefined color definitions directly for use? If you know the HTML color names, you'll already know most of them. Last count was.... over 250ish? 260ish? I think?
Thanks both; lots for me to think about. As someone once said, there's more than one way to flay a feline.
@ Steve "In a program with a crap load of color changes, used as this is intended to be used? I'd just do like this -- define a quick sub with the chosen color and have it set it, and be done with it." Isn't that what I've done?
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) 
Please visit my Website at: http://oldendayskids.blogspot.com/

Please visit my Website at: http://oldendayskids.blogspot.com/


