SECTION 8

[continue/next section] [MAIN/Introduction] [table of contents]

8. Using 80-Columns


TABLE OF CONTENTS

8.1 INTRODUCTION

8.2 THE 40/80 KEY

8.3 USING PREPACKAGED 80 COLUMN SOFTWARE

8.4 CREATING 80 COLUMN PROGRAMS

8.5 USING 40 AND 80 COLUMNS TOGETHER

8.1 INTRODUCTION

In C128 and CP/M modes, you can choose between a 40- en 80-column screen display. You could even use both in a single program.

Each screen size has special uses. The 40-column screen is the same size the Commodore 64 uses. With the 40-column screen you can use the Commodore 128's full graphic capabilities. You can draw circles, graphs, sprite characters, boxes and other shapes in high resolution or multicolor graphic modes. You can also use sprites.

If you are using 80-columns, you get twice the number of characters per program line. In 80-column mode you can use the standard graphic characters and colors available through the keyboard.

You can also write programs using two monitors to take advantage of both screen display formats with each monitor screen performing different aspects of the program. For example, text output could be displayed on the 80-column monitor while graphics output could be seen on the 40-column monitor.

8.2 THE 40/80 KEY

You can use the {40/80 display} key to set the screen width as either 40 or 80 columns. Pressing this key will only have an effect when one of the following actions is taken:

  1. The power is turned ON.
  2. The {reset} button is pressed.
  3. The {run/stop} and {restore} buttons are pressed simultaneously.

The {40/80 display} key acts like a {shift lock} key: it locks when you press it, and does not release until you press it again. If this key is up (not pressed) when one of the three conditions above occurs, the screen is set to 40 columns. If you press the key down, causing it to lock, and one of the three conditions listed above then occurs, the screen is set to 80 columns. Once the computer is running in one screen format (40- or 80-columns), you cannot switch to the other format using the {40/80 display} key. In this case you must press and release the {esc} key and then press the {X} key.

8.3 USING PREPACKAGED 80 COLUMN SOFTWARE

Most CP/M programs utilize an 80-column screen, as do many of the other business application packages you can use in C128 mode. Since the width of a normal printed page is 80 columns, an 80-column wordprocessor can display information on the screen exactly as that information will appear on paper. Spreadsheet programs often specify an 80-column format, in order to provide enough space for the necessary columns and categories of information. Many database packages and telecommunications programs also require or can use an 80-column screen.

8.4 CREATING 80 COLUMN PROGRAMS

In addition to running prepackaged software, the 80-column screen width can be useful in designing you own programs. You've probably noticed what happens when you type a line that is wider than 40 columns on a 40-column screen. The lines "wrap around", that is, the continue onto the next screen line. This may cause confusion in reading the line, and can even lead to progamming errors. An 80-column screen helps eliminate these problems. In general, an 80-column screen allows for a clearer screen and better organization.

8.5 USING 40 AND 80 COLUMNS TOGETHER

The main advantage of 40-column composite video is the availability of bit mapped graphics, while 80-columns gives you output for word processing and other business applications. If you have two monitors, you can write programs that are "shared", using the text features 80-columns affords you and the graphics of 40-columns. A special command (GRAPHIC 1,1) can be used within a program to transfer the execution of graphics commands to the 40-column display. If you have a dual monitor (one that can display both 40- nd 80-columns format) you can place GRAPHIC 1,1 statements in your program so that graphics will be output in 40-column screen format. In order to view the graphic output, however, you will need to change the video switch on the monitor to 40-columns. If you write a program like this, it might be a good idea to include on-screen directions to the user to change the video switch.

For example, you might write a program which asked the user to input data, then create a bar graph based on the user's input. The message "CHANGE TO 40 COLUMN TO VIEW GRAPH" would tell the user to switch modes and see the results.

As noted previously, you can switch between 80- and 40-column formats after power-up, with the {esc x} sequence.

The following example shows how dual screens can be used within a program:

10 GRAPHIC 5,1:SCNCLR                   :REM SWITCH TO 80 COLUMN AND
   CLEAR IT
20 PRINT "START IN 40 COLUMN BY SELECTING THE COMPOSITE VIDEO"
30 PRINT "INPUT OF YOUR DUAL MONITOR."
40 PRINT
50 PRINT "PRESS THE RETURN KEY WHEN READY."
60 GETKEY A$:IF A$ <> CHR$(13) THEN 60
70 GRAPHIC 2,1                          :REM SELECT SPLIT SCREEN MODE
80 CHAR 1,8,18,"BIT MAP/TEXT SPLIT SCREEN"
90 FOR I = 70 TO 220 STEP 20:CIRCLE 1,I,50,30,30:NEXT I
100 PRINT
110 PRINT " SWITCH TO 80 COLUMN BY SELECTING THE"
120 PRINT " RGBI VIDEO INPUT OF YOUR DUAL MONITOR,"
130 PRINT " THEN PRESS THE RETURN KEY WHEN READY."
140 GETKEY A$:IF A$ <> CHR$(13) THEN 140
150 GRAPHIC 5,1                         :REM SWITCH OUTPUT TO THE 80
    COLUMN
160 FOR J = 1 TO 10
170 PRINT "YOU ARE NOW IN 80 COLUMN TEXT MODE."
180 NEXT J:PRINT
190 PRINT "NOW SWITCH BACK TO 40 COLUMN OUTPUT."
200 PRINT "PRESS THE RETURN KEY WHEN READY."
210 GETKEY A$:IF A$ <> CHR$(13) THEN 210
220 GRAPHIC 0,1                         :REM SWITCH OUTPUT TO THE 40
    COLUMN
230 PRINT
240 FOR J = 1 TO 10
250 PRINT " YOU ARE NOW IN 40 COLUMN TEXT OUTPUT."
260 NEXT J
270 END

Each screen display format offers certain advantages; yet the two types of displays can be combined in a program to complement each other. Using a 40-column screen, you can get the full power of advanced BASIC graphics. The 80-column display gives you more space for your own programs. In addition, it lets you run the wide variety of software designed to run on an 80-column screen.

***************************************************************************

This section of this chapter have introduced you to the many features and capabilities provided by the Commodore 128 in C128 mode. The following chapter tells you how to use the Commodore 128 in C64 mode.

[top of document]

page URL: www.bigfoot.com/~c128page/c128sg/sect-07c.htm
contact: c128page@bigfoot.com