100 '             3-D BAR GRAPH
110 '             BY BILL BURKETT
120 '             HOUSTON, TEXAS
130 '        PORTABLE COMPANION, JUNE, 1983
140 E$=CHR$(27): 'ESCAPE
150 DC$=E$+"=":  'DIRECT CURSOR ADDRESSING PREFIX
160 UY$=E$+"l":  ' START UNDERLINING ("l") IS A LETTER
170 UN$=E$+"m":  ' STOP  UNDERLINING
180 DIM X$(20),I(20),U(20),N(20),T(20),AV(20)
190 F$=CHR$(150):G$=CHR$(127):E$=CHR$(153):B$=CHR$(128)
200 T=0: A=0
210 PRINT CHR$(26): 'CLEAR SCREEN
220 PRINT STRING$(10,B$)+" VARIABLE BAR GRAPH "+STRING$(10,B$):PRINT:PRINT
230 PRINT "NUMBER OF OBSERVATIONS COVERED, (MAX=20)"
240 INPUT N
250 C$=STRING$(3,G$)
260 PRINT:PRINT "WHAT IS THE SCALE FACTOR, (ie..5,10,50,100 etc.)"
270 INPUT S
280 PRINT:PRINT "ONE(1) LINE OF ";C$;" = ";S
290 FOR I = 1 TO N
300 PRINT:PRINT"NAME OF OBSERVATION NO.";UY$;I;UN$
310 INPUT X$(I)
320 X$(I)=LEFT$(X$(I),3)
330 PRINT"NUMBER OF UNITS FOR ";UY$;X$(I);UN$;" = ";:INPUT U(I)
340 PRINT
350 T=T+U(I)
360 U(I)=U(I)/S
370 NEXT I:PRINT
380 PRINT CHR$(26)
390 PRINT:PRINT "PRESS ANY KEY TO CONTINUE"
400 M = 28
410 PRINT CHR$(26)
420 FOR I = 1 TO N
430 K=U(I)
440 P$=LEFT$(X$(I),3)+SPACE$(1)
450 IF K>20 THEN 460 ELSE 480
460 IF K < 40 THEN K=K/2:GOTO 490
470 IF K > 40 THEN K=K/4:GOTO 500
480 P0$=STRING$(3,G$)+E$:GOTO 510
490 P0$=CHR$(110)+CHR$(47)+CHR$(50)+E$:GOTO 510
500 P0$=CHR$(110)+CHR$(47)+CHR$(52)+E$:GOTO 510
510 P1$=STRING$(3,G$)+F$
520 P2$=CHR$(138)+STRING$(3,F$)
530 L=54:M=M+5
540 J=1
550 PRINT DC$;CHR$(L);CHR$(M);P$
560 L=L-1
570 PRINT DC$;CHR$(L);CHR$(M);P0$
580 GOTO 600
590 PRINT DC$;CHR$(L);CHR$(M);P1$:J=J+1
600 IF J<K THEN L=L-1:GOTO 590
610 IF J>=K THEN L=L-1:GOTO 620
620 PRINT DC$;CHR$(L);CHR$(M);P2$
630 NEXT I
640 PRINT DC$;"7 ";"PRESS ANY KEY TO CONTINUE";
650 Q$=INKEY$:IF Q$="" THEN 660 ELSE 665
660 PRINT:PRINT
670 AV=T/N:PRINT "TOTAL OF UNITS FOR OVERALL PERIOD = ";UY$;T;UN$
680 PRINT"AVERAGE UNITS FOR ";UY$;N;UN$;" OBSERVATIONS = ";UY$;AV;UN$
690 PRINT:PRINT"PRESS 'V' FOR ANOTHER VARIABLE BAR GRAPH
700 Q$=INKEY$:IF Q$="" THEN 700 ELSE 710
710 IF Q$="V" OR Q$="v" THEN 190
720 END
PRESS 'V' FOR ANOTHER VARIABLE BAR GRAPH
700 Q$=INKEY$: