06-28-2024, 05:58 AM
(This post was last modified: 06-28-2024, 03:35 PM by TerryRitchie.)
In lesson 5 of the tutorial the legacy screens are covered and explained. As Steve pointed out the legacy screens had limitations imposed by QuickBasic and the hardware of the time.
QB64 can break the limitations of all legacy screens including SCREEN 0.
Personally I think all the legacy graphics screens are useless unless needed for legacy source code that relies on them. You should be creating all your screens using the _NEWIMAGE statement, including SCREEN 0:
SCREEN _NEWIMAGE(80, 25, 0) ' same as legacy SCREEN 0 with 80x25 text
SCREEN _NEWIMAGE(132, 66, 0) ' the dimensions of a wide format sheet of printer paper 132x66 text
SCREEN _NEWIMAGE(80, 66, 0) ' the dimensions of a standard sheet of printer paper 80x66 text
QB64 even allows the use of screen pages (PCOPY) with SCREEN 0 and screen 0 text screens created with _NEWIMAGE.
Using _NEWIMAGE has benefits:
VideoScreen& = _NEWIMAGE(80, 25, 0) ' 80x25 text for terminal
PrinterPaper& = _NEWIMAGE(80, 66, 0) ' 80x66 text for standard printout
WidePrinterPaper& = _NEWIMAGE(132, 66, 0) ' 132x66 text for wide carriage printout
Now switch between the screens at will using the SCREEN statement:
SCREEN VideoScreen&
SCREEN PrinterPaper&
SCREEN WidePrinterPaper&
QB64 can break the limitations of all legacy screens including SCREEN 0.
Personally I think all the legacy graphics screens are useless unless needed for legacy source code that relies on them. You should be creating all your screens using the _NEWIMAGE statement, including SCREEN 0:
SCREEN _NEWIMAGE(80, 25, 0) ' same as legacy SCREEN 0 with 80x25 text
SCREEN _NEWIMAGE(132, 66, 0) ' the dimensions of a wide format sheet of printer paper 132x66 text
SCREEN _NEWIMAGE(80, 66, 0) ' the dimensions of a standard sheet of printer paper 80x66 text
QB64 even allows the use of screen pages (PCOPY) with SCREEN 0 and screen 0 text screens created with _NEWIMAGE.
Using _NEWIMAGE has benefits:
VideoScreen& = _NEWIMAGE(80, 25, 0) ' 80x25 text for terminal
PrinterPaper& = _NEWIMAGE(80, 66, 0) ' 80x66 text for standard printout
WidePrinterPaper& = _NEWIMAGE(132, 66, 0) ' 132x66 text for wide carriage printout
Now switch between the screens at will using the SCREEN statement:
SCREEN VideoScreen&
SCREEN PrinterPaper&
SCREEN WidePrinterPaper&