330 LPRINT H$;H$;"d";: A$="j": GOSUB 800: LPRINT "c"

335 LPRINT: LPRINT

340 LPRINT C$;H$;H$;H$; " JAN"; H$; " FEB";H$;~~MAR":

LPRINT

390 LPRINT CHR$(27)"@": END

Line 300 closes the P and M loops, prints the right-hand border, and sends control to either 310 or 320. Line 310 prints the districts. Lines 320 through 340 print the bottom portion of the chart.

Check your listing against the one shown as Figure 17-2. Now it’s time to RUN your program and see if it looks like the printout near the beginning of this chapter.

You can change the heights of the bars by changing the data in line 40. Go ahead and SAVE the program as BARCHART if you like.

10 FOR J=1 TO 3: FOR K=1 TO 3

20 READ MAX (J,K)30 NEXT K: NEXT J40 DATA 12,18,23,28,36,34,28,27,30

50 B$=CHR$(27)+"E"

60 D$=CHR$(27)+"J"+CHR$(11): C$=CHR$(27)+"F" 70 DATA 2,1,64,32,16,8,4,2,1,64,32

80 DATA 127,0,99,0,65,0,65,0,99,0,12790 DATA 127,0,28,0,62,65,62,0,28,0,127

100 LPRINT CHR$(27) "3"CHR$(10) CHR$(27)"U1";

110LPRINT CHR$(27) ":"CHR$(0)CHR$(0)CHR$(0);

120LPRINT CHR$(27)"%"CHR$(1)CHR$(0);

130LPRINT CHR$(27)"&WR$(0)CHR$(94)CHR$(107);

140FOR Y=1 TO 14: LPRINT CHR$(139);

150FOR X=1 TO 11: READ C: LPRINT CHR$(C);: NEXT X

160NEXT Y: LPRINT CHR$(27)"C"CHR$(33);

190LPRINT CHR$(27)"D"CHR$(14)CHR$(19)CHR$(24)

CHR$(34)CHR$(44)CHR(54);

200 LPRINT CHR$(60)CHR$(1);: H$=CHR$(137): Z=1

210 LPRINT H$;H$; ABC CO. SALES: FIRST QUARTER 1995": LPRINT: LPRINT

220 LPRINT H$;H$;B$;"a";: N=34: A$="j": GOSUB 800: LPRINT "b"

230 LPRINT H$;H$;"k";H$;H$jH$;H$;"k"

240 FOR R=39 TO 1 STEP -1: LPRINT H$;: F=0

250 IF R/10=INT(R/10) THEN LPRINT R;: F=1 260 LPRINT B$;H$;"g";D$;C$;

Figure 17-2.Program for BARCHART

230