The Final Push

The DATA for the population figure is READ into array A in line 30.

Each figure is printed in SUBroutine 300.

DATA line 130 determines how many figures are printed on each row.

We have the makings of a horizontal bar graph, but it needs some trimmings. Let’s add a few labels and move the whole works over a bit.

20PRINT : PRINTCHR$(27)"A"CHR$(7) 50 GOSUB 200 : PRINT

70 PRINT TAB(5)1990 - R;

80 GOSUB 200 : READ N

110 GOSUB 200 : PRINT

200PRINT TAB(12)CHR$(27)"K"CHR$(5)CHR$(PI);

210FOR I=1 TO 5 : PRINT CHR$(127); : NEXT I

220RETURN

TRS-80 Model I:

200 LPRINT TAB(12)CHR $ (27)"K"CHR $ (5)CHR $ (2);

and RUN.

Figure 7-9

That’s better. Subroutine 200 prints the vertical bar that separates the labels and the graph.

If we add a quick title and legend, we’ll be done.

65