To set the specifications for the display screen.
SCREEN [mode] [,[colorswitch]][,[apage]][,[vpage]]
The SCREEN statement is chiefly used to select a screen mode appropriate for a particular display-hardware configuration. Supported hardware configurations and screen modes are described below.
The IBM Monochrome Display and Printer Adapter (MDPA) is used to connect only to a monochrome display. Programs written for this configuration must be text mode only.
The IBM Color Graphics Adapter (CGA) and Color Display are typically paired with each other. This hardware configuration permits the running of text mode programs, and both medium-resolution and high-resolution graphics programs.
The five screen modes 0, 1, 2, 7, and 8 allow you to interface to the IBM Color Display when it is connected to an IBM Enhanced Graphics Adapter (EGA). If EGA switches are set for CGA compatibility, programs written for modes 1 and 2 will run just as they would with the CGA. Modes 7 and 8 are similar to modes 1 and 2, except that a wider range of colors is available in modes 7 and 8.
With the EGA/IBM Enhanced Display configuration, modes 0, 1, 2, 7, and 8 are virtually identical to their EGA/Color Display counterparts. Two possible differences are as follows:
The full capability of the Enhanced Color Display is taken advantage of in this mode. Mode 9 allows the highest resolution possible for the EGA/Enhanced Color Display configuration. Programs written for this mode will not work for any other hardware configuration.
The IBM Monochrome Display can be used to display monochrome graphics at a very high resolution in this mode. Programs written for this mode will not work for any other hardware configuration.
The mode argument is an integer expression with legal values 0, 1, 2, 7, 8, 9, and 10. All other values are illegal. Selection of a mode argument depends primarily on your program's anticipated display hardware, as described above.
Each of the SCREEN modes is described individually in the following paragraphs.
The following are default attributes for SCREEN 10, monochrome display:
|Attribute Value||Displayed Pseudo-Color|
|1||On, normal intensity|
|3||On, high intensity|
The following are color values for SCREEN 10, monochrome display:
|Color Value||Displayed Pseudo-Color|
|1||Blink, off to on|
|2||Blink, off to high intensity|
|3||Blink, on to off|
|5||Blink, on to high intensity|
|6||Blink, high intensity to off|
|7||Blink, high intensity to on|
For both composite monitors and TVs, the colorswitch is a numeric expression that is either true (non-zero) or false (zero). A value of zero disables color and permits display of black and white images only. A nonzero value permits color. The meaning of the colorswitch argument is inverted in SCREEN mode 0.
For hardware configurations that include an EGA and enough memory to support multiple-screen pages, two arguments are available. These apage and vpage arguments determine the "active" and "visual" memory pages. The active page is the area in memory where graphics statements are written; the visual page is the area of memory that is displayed on the screen.
Animation can be achieved by alternating the display of graphics pages. The goal is to display the visual page with completed graphics output, while executing graphics statements in one or more active pages. A page is displayed only when graphics output to that page is complete. Thus, the following program fragment is typical:
SCREEN 7,, 1, 2 'work in page 1, show page 2 . . Graphics output to page 1 . while viewing page 2 .
SCREEN 7,,2,1 'work in page 2, show page 1 . . Graphics output to page 2 . while viewing page 1 .
The number of pages available depends on the SCREEN mode and the amount of available memory, as described in the following table:
SCREEN Mode Specifications
|Mode||Resolution||Attribute Range||Color Range||EGA Memory||Pages||Page Size|
a Numbers in the range 16-31 are blinking versions of the colors 0-15.
b Attributes applicable only with EGA.
For various screen modes and display hardware configurations, different attribute and color settings exist. (See the PALETTE statement for a discussion of attribute and color number.) The majority of these attribute and color configurations are summarized in the following table:
Default Attributes and Colors for Most Screen Modes
|Attributes for Mode||Color Display||Monochrome Display|
|9||9||Light Blue||High intensity (underlined)|
|10||10||Light Green||2||High intensity|
|1||11||11||Light Cyan||2||High intensity|
|12||12||Light Red||2||High intensity|
|2||13||13||Light Magenta||2||High intensity|
a Off when used for background.
b With EGA memory > 64K.
c Only for mode 0 monochrome.
The default foreground colors for the various modes are given in the following table:
Default Foreground Colors
|Default foreground attribute||Default foreground color|
|Screen mode||Color/Extended Displaya||Monochrome Display||Color/Extended Displaya||Monochrome Display|
a IBM Enhanced Color Display
b 15 if greater than 64K of EGA memory