2 Customizing The Graphics Modes

Add A Text Window To GRAPHICS 0

Charles Brannon

The text window can be a useful feature in the graphics modes, enabling a simultaneous text and graphics display. The text window is very similar to a miniature GRAPHICS 0 text screen: all the editor functions are supported, and scrolling and screen clearing are confined to the small four-line window.

This same capability would be useful for a GRAPHICS 0 display. For example, a menu (a list of choices) could be presented in the top 20 or so lines of the screen, and the user's input taken in the lower four lines of the text window. Any errors, such as the user typing editor keys in an INPUT statement, would not interfere with the rest of the screen. Conveniently, any scrolling when caused by a line like this one:


would not cause the menu above it to scroll as well.

How is all this done? With a single POKE statement. Location 703 normally contains the number 24. If you POKE a four in its place, the cursor is zapped to the bottom of the screen and the text window is in place.

Note that you can't print to the upper part of the screen with PRINT statements; you have to use PRINT#6 as you do with graphics modes 1 and 2. Also, the POSITION statements affect only the upper part of the display; you must use POKEs to position text window output.

Here is an example program to demonstrate the use of the window. It is a simple disk menu program. Notice that you don't need to use PRINT#6 to print to the upper part of the screen until after the POKE 703,4 takes place.

Download P045L1.BAS (Saved BASIC)
Download / View P045L1.LST (Listed BASIC)

Return to Table of Contents | Previous Section | Next Section