Clear Cut Trends

If you own a Radio Shack high-resolution graphics board for your Model III or 4, you're probably wondering when you'll see some software for it. Your wait is over: Grapher produces high-resolution line and bar graphs you can produce on any graphics printer. It also works on the Models 1000 and 1200.

Grapher lets you draw and display four kinds of graphs in high-resolution mode: line graphs for monthly data and for a 10-year data summary, and bar graphs for monthly data and for annual averages. You can enter data in single-precision (under nine digits) or double-precision (under 12 digits) format.

Grapher isn't a statistical analysis program; it's capable of monthly/annual data displays only. Also, you won't be able to graph the national debt (or any other number over 999,999,999,999.99).

Getting Started

Grapher, the main program, appears in Program Listing 1 (p. 46). Program

Listing 2, Printer (p. 79), provides all Grapher's print functions. GraphCalc, in Program Listing 3 (p. 80), calculates scales for the X axis on each graph. Figure 1 lists the primary routines in each of these programs. See Program Listing 4 (p. 81) for Model 1000/1200 changes.

Printer and GraphCalc cannot reside in memory at the same time. To coordinate control of these two modules, Grapher uses a flag (SWFLG) to load the modules (via the chain merge command in lines 5870-5890) and keep track of which module is in memory.

You must save Listings 2 and 3 in ASCII format (SAVE "PRINTR",A) and you shouldn't renumber any of the listings as the line numbers are important for merging procedures. Save Listing 1 with Listing 3 merged into it.

Running Grapher

Type in and run Grapher, in Listing 1, using BASICG on the disk that came with your high-resolution graphics kit.

Grapher displays a main menu as shown in Fig. 2. You don't need to reserve any memory to run the program and you have to open at least one file. Once running, the program is self-explanatory.

Inputting Data

The first option on the menu accepts data from the keyboard. Press the 1 key and Grapher tells you that it's clearing old data. Then it prompts you to enter the title you want displayed on the graph. Enter an appropriate title of up to 55 characters.

Grapher prompts you to enter a label of up to 10 characters you want to appear above the X axis (e.g. Percent, Billions). The program then requests the g first year for which you're enter- | ing data. 1

Grapher prompts you to choose sin- J gle- or double-precision format. If your ^ numbers are all shorter than seven digits, f use single-precision. If any numbers ex- | ceed seven digits, you have to use I

by Bruce A. and Jeffrey P. Graebner double-precision. Don't use double-precision unless necessary, because it slows program execution.

After you choose the precision you can start entering data. Don't include commas or dollar signs in your entries. Press the enter key after entering each item.

Grapher prompts you for each month and year. Be sure to watch that you and the computer remain synchronized. Also, sometimes the computer takes a moment between entries to catch up. You can drop a digit in an entry without knowing it if you're not careful. When you're finished entering data, type in - 99, an end-of-data control code.

Editing the Data

Option 4 lets you edit data. When you select this option, the program displays the current title and asks if you want to change it. Press the N key to go to the next prompt; press Y to change the title.

Grapher then asks if you want to edit data. Hit the N key to return to the menu, or type Y to continue. Grapher prompts you for the month and year of the data you want to change, then displays the old data and prompts you for changes. Finally, Grapher asks if you want to return to the main menu or edit more data. If the data is correct as shown, press the N key to return to the menu.

Adding Data

Select option 5 to add data. The program automatically locates the last item entered so you can start from where you left off. Grapher handles 10 years' worth of data. When you reach the 11th year, Grapher drops the first-year data, but not before displaying a warning to that effect.

If you want to drop the first year and add a new one, answer yes at the prompt. Grapher deletes the first year of data, moves all remaining data up one year, and waits for you to enter the new year's data. Enter the new figures and type in - 99 when you're finished.

Loading and Saving Data

Options 2 and 6 load and save data, respectively. To load or save a file, enter the file name (up to eight characters long) at the prompt. Don't include an extension: Grapher automatically adds the extension /GDT.

The program prompts you for a drive number between 1 and 3. Pressing the enter key defaults to drive 1 (you can change the default drive in lines 4720, 4730, 4990, and 5000). Grapher then writes to or reads from the appropriate disk.

System Requirements

Models m and 4 High-Resolution Board Models 1000 and 1200 Printer optional

Was this article helpful?

0 0

Post a comment