@Dav Also, you're saving the last COLOR parameters the user of your library had set - in this case the last COLOR parameters you had set yourself before calling the sub. No way to do that with the SCREEN trick, as you have to pick a location to read the color from.
@Pete ❤️
There's always a way. If there wasn't, we woudn't have QB64 in the first place. It's just a question of the level of complexity needed in the chewing gum and bailing wire operations. I've gone as far as memory mapping, in a graphics gui thing I put together. This was before _MEMBLOCK came out and made my approach obsolete.
It's always a trade off. Better keywords create easier coding, but take away from solution based thinking on a lower level. One can only hope that coders will be freed up to use those solution skills for higher purposes.
Personally, I wanted this _DEFAULTCOLOR and _BACKGROUNDCOLOR stuff in QuickBASIC. I never could understand why the last color set couldn't be retrieved from memory. In Atari, that was accomplished with PEEK/POKE. Also, speaking of AtariBASIC, we could easily change the 8x8 pixels of any character, into a custom character. That feature made it super easy to underline words. I suppose if I want to do that with QB64, I'd have to go the way of unicode characters. That's probably something I'll be looking into in the near future. Fingers crossed it will include SCREEN 0, the only screen mode anyone should ever need.
Pete