90 FOR I = 1 TO 6: READ Y$: NEXT :N = 36: DIM K$(N): FOR I = 0 TO N: READ K$(I): NEXT :NF = 0: FOR I = 800 TO 809: READ J: POKE I,J: NEXT
110 ONERR GOTO 130
120 GOTO 140
130 CALL 800: HOME : PRINT : PRINT "The disk in the current drive": PRINT "must have files CHARTWORKS.BIN & CHSET": VTAB 23: END
140 D$ = CHR$(4):J = 0: FOR I = 24576 TO 24596:J = J + PEEK(I): NEXT : FOR I = 15504 TO 15524:J = J + PEEK(I): NEXT : IF J < >5512 THEN PRINT D$"BLOADCHARTWORKS.BIN,A$6000": PRINT D$"BLOADCHSET,A$3C00": POKE 232,0: POKE 233,60
2650 K = 3: FOR I = 1 TO S2 -1:P% = YY -YB -I *TY *SY +.5: HPLOT XB,P% TO XB +3,P%:Y$ = STR$(ZY +TY *I):L = LEN(Y$): IF L >3 THEN L = 3
2660 X = XB -9 -6 *(L -1): GOSUB 1850: NEXT :N = 1: IF S1 >10 THEN N = 2
2670 K = 0: FOR I = 1 TO S1 -1 STEP N:P% = XB +I *TX *SX +.5: HPLOT P%,YA +3 TO P%,YA:Y$ = STR$(ZX +TX *I/HX):L = LEN(Y$): IF L >3 THEN L = 3:Y = VAL(Y$): IF ABS(Y - INT(Y)) <.01 THEN Y$ = STR$( INT(Y)):L = LEN(Y$): IF L >3 THEN L = 3
2680 X = P% -3.5 *(L -1):P% = YY: GOSUB 1850: NEXT
2690 IF G <3 THEN 2750
2700 TX = XA/D:X = XB: IF H = 3 THEN TX = TX/2
2710 FOR I = 0 TO D -1: ON H GOTO 2720,2730,2720
2720 Y = YA -X%(I): GOSUB 1820: IF H = 1 THEN 2740
2730 Y = YA -Y%(I): ON H GOSUB 1820,1820,1830
2740 NEXT : GOTO 2810
2750 FOR I = 1 TO NX:X = XB +(X(I) *(10 ^PX) -ZX) *SX +.5:Y = YA -(Y(I) *(10 ^PY) -ZY) *SY +.5: IF Y > = YB AND Y < = YA AND X > = XB AND X < = XA +XB THEN DRAW SB AT X,Y
2760 NEXT : IF G = 1 THEN 2810
2770 J = 0: FOR I = 0 TO 1:E%(I) = XB +(T(I) *(10 ^PX) -ZX) *SX +.5: IF E%(I) <XB OR E%(I) >XA +XB THEN J = 1
2780 NEXT : IF J THEN 2810
2790 FOR I = 2 TO 3:E%(I) = (T(I) *(10 ^PY) -ZY) *SY +.5: IF YA -E%(I) >YA OR YA -E%(I) <YB THEN J = 1
2800 NEXT : IF NOT J THEN HPLOT E%(0),YA -E%(2) TO E%(1),YA -E%(3)
2810 ML = 0: GOSUB 270: RETURN
2820 REM PLOT SUB-MENU
2830 IF NX = 0 AND NY = 0 THEN V$(0) = "The arrays are empty. You must " +K$(2) +" first": GOSUB 1220: RETURN
2840 FOR I = 1 TO 6:V$(I) = K$(I +17): NEXT :V$(7) = K$(5):S = 17:T = 8:Q = 16:VS = 8:K = 8: GOSUB 730:VV = 0:G = Q -1: ON Q GOSUB 1920,2850,2850,2920,2960,1970,3020: TEXT : PRINT D$"PR#3": GOTO 2840
2850 C = (NY >0) +2 *(NX >0): IF C <3 THEN V$(0) = K$(32) +K$(13 +C) +K$(33): GOSUB 1220: RETURN
2860 IF GF = 1 THEN PRINT : PRINT K$(30);: GOSUB 240: IF Q$ = "Y" OR Q$ = "y" THEN SB = SB +1 -6 *(SB = 69):VV = 1: GOTO 2890
3050 HOME : CALL EG: PRINT D$"PR#3": HOME : PRINT : VTAB 10: HTAB 8: INVERSE : PRINT "REPLACE";: NORMAL : PRINT " The program disk with an AppleWorks data disk, please": PRINT
3060 PRINT "Leave the data disk in the drive at all times!": PRINT : PRINT "If you replace one data disk with another, and do not then ": PRINT : INVERSE : PRINT K$(0);: NORMAL
3070 PRINT " before doing anything else": PRINT : PRINT "the data that you will get will be very strange indeed!": GOSUB 1190: HOME
3080 REM MAIN MENU
3090 TEXT : PRINT D$"PR#3": FOR I = 1 TO 7:V$(I) = K$(I -1): NEXT :T = 7:VS = 6:K = 8:S = 0
3100 Q = 9: GOSUB 730: IF C >1 AND F$ = "" THEN V$(0) = "YOU MUST " +K$(0) +" FIRST": GOSUB 1220: GOTO 3100
3110 POKE EE,0: HOME : ON Q GOSUB 1730,1640,1600,1010,2830,3020,3040: GOTO 3090
3120 DATA " ",X,Y,FREQUENCY,X,Y
3130 DATA Select a file,Display the file,Read the file,Inspect data,Plot a graph,View previous plot,Send screen to printer,End program,Return to Main Menu
3140 DATA "Main Menu","Read data from:","a Column","a Row","Read data into:","X Array","Y Array"
3150 DATA "Plot Sub-Menu","Plotting Choices:" ,Clear screen,"Scatter plot","Scatter plot + least squares line","Histogram"
3160 DATA "Add Titles & Legends","Erase Titles & Legends","Plot Title"," for X-Axis"," for Y-Axis","Key in:"
3170 DATA "Minimum","Maximum","Overlay previous plot"
3180 DATA "Current data disk has no Spread Sheet files","You can't do that. The "," is empty"
3190 DATA "for X & Y","Input error"
3200 DATA "Press Return to continue"
3210 DATA 104,168,104,166,223,154,72,152,72,96
9000 TEXT : HOME : PRINT CHR$(4)"PR#3": VTAB 23
9010 IF PEEK(222) = 133 THEN PRINT "DIVISION BY ZERO ERROR": PRINT "INSPECT YOUR DATA BEFORE PLOTTING.": GOTO 9030
9020 PRINT "FATAL ERROR AT LINE "; PEEK(218) +256 * PEEK(219)
9030 PRINT "PRESS RETURN TO RESTART ";: POKE -16368,0: GET A$: RUN