09-30-2022, 03:05 PM
(09-30-2022, 08:15 AM)RhoSigma Wrote:(09-30-2022, 02:30 AM)TerryRitchie Wrote: I working on Lesson 20: Libraries and was thinking about having the user go through the process of making one. My idea was to make custom text inputs, popups, message boxes, etc... However, the library would need to know which SCREEN mode it was in first for dimensions, available colors, current colors, etc.
All that information can be easily acquired with existing keywords _WIDTH(0), _HIGHT(0), _PIXELSIZE(0), _DEFAULTCOLOR(0) and _BACKGROUNDCOLOR(0).
On the other hand it's eg. bad to assume the screen's dimension just from the mode number, since it's possible to create ANY size legacy screens with SCREEN _NEWIMAGE(w, h, mode).
Thanks for all the input everyone. Last night I decided to make the library SCREEN 0 only. If _PIXELSIZE reports anything other than 0 the library will report the mis-match.
I understand the reasoning for others pointing out that legacy screen modes should be avoided but they do exist and can be used. Over the years I've known of at least a few QuickBasic projects that were updated using QB64 because I was asked to help with some of the conversion. One was a program that controlled a small milling machine and it drew the routing outline in screen 12. Creating a library that may potentially be used with legacy screen modes still needs to be considered.
Over the years I've also had people contact me while using the tutorial to ask questions about programs they were typing in from old QuickBasic books. Those old books and programs are still a wealth of knowledge for people learning QB64 even though they use the legacy screen modes.
This gives me an idea for another lesson that deals with converting QuickBasic, PDS, and VBDOS code to use new QB64 commands. Hmm...