5 DEF SEG=64:A=PEEK(23):IF NOT(A AND 32) THEN POKE 23,(A OR 32)
6 DEF SEG:CLEAR,,1024:OPTION BASE 1:DEFINT A-C,N,T,Z:DEFSTR D
7 OPEN "EPISETUP.DAT" FOR INPUT AS #1
8 INPUT #1,CLR1,CLR2,CLR3,SCRN,PRNT,TYP$:CLOSE #1
9 SCREEN 0,SCRN,0:WIDTH 80:COLOR CLR1,CLR2,CLR3:KEY OFF
10 FOR Z=1 TO 10:KEY Z,"":NEXT:AR=13-SCRN*6:LOCATE ,,1,1,13:LOCATE ,,1,AR,AR
20 CLS:RESTORE 22:READ DTTL,TTB,TTL:PRINT TAB(TTB);"?";STRING$(TTL,205);"?":PRINT TAB(TTB);"? ";DTTL;" ?":PRINT TAB(TTB);"?";STRING$(TTL,205);"?":PRINT
4000 PRINT TAB(10);:INPUT "Enter the name of the DATAFILE you wish to analyze:  ",FILE$
4020 ON ERROR GOTO 5020:OPEN FILE$ FOR INPUT AS #1:INPUT #1,A,C
4040 FOR T=1 TO A:INPUT #1,T(T):NEXT
4050 FOR T=1 TO A:FOR Z=1 TO C:INPUT #1,D(T,Z):NEXT:NEXT
4060 FOR T=1 TO A:FOR Z=1 TO T(T):INPUT #1,CS(T,Z):NEXT:NEXT
4070 FOR T=1 TO A:INPUT #1,N$(T),X(T),X2(T),MD(T),SD(T):NEXT:CLOSE #1:RETURN
4100 LOCATE AR,53:PRINT TAB(63):LOCATE AR,15:INPUT "Enter the name of your new DATAFILE:  ",FILE$
4110 ON ERROR GOTO 5040:OPEN FILE$ FOR OUTPUT AS #1
4120 WRITE #1,A,C:FOR T=1 TO A:WRITE #1,T(T):NEXT
4130 FOR T=1 TO A:FOR Z=1 TO C:WRITE #1,D(T,Z):NEXT:NEXT
4140 FOR T=1 TO A:FOR Z=1 TO T(T):WRITE #1,CS(T,Z):NEXT:NEXT
4150 FOR T=1 TO A:WRITE #1,N$(T),X(T),X2(T),MD(T),SD(T):NEXT:CLOSE #1:RETURN
4200 LOCATE AR,AC:INPUT;"",NS:IF NS>0 AND NS<=A THEN PRINT " `";N$(NS);"'":RETURN ELSE BEEP:LOCATE 25,22:PRINT FILE$;" has only";A;"samples.";:LOCATE AR,AC:PRINT "     ":GOTO 4200
5020 BEEP:PRINT:DR$="":IF ERR<>52 AND ERR<>53 AND ERR<>71 THEN 5010 ELSE PRINT TAB(13); "I cannot find a file by that name on ";
5025 IF MID$(FILE$,2,1)=":" THEN DR$=LEFT$(FILE$,2) ELSE PRINT "default ";
5030 PRINT "drive ";DR$:PRINT "Your files are:":FILES DR$+"*.*"
5035 RESUME 4000
5040 BEEP:LOCATE 25,10:IF ERR=61 OR ERR=67 THEN PRINT TAB(17);"That disk is full.  Change disks and try again.";:RESUME 4100
5045 IF ERR=64 OR ERR=52 THEN PRINT TAB(16);"That is not a valid FILE NAME.  Please change name.";:RESUME 4100
5050 IF ERR=70 THEN PRINT "That disk is write-protected.  Put your data on a different disk.";:RESUME 4100
5055 IF ERR=71 THEN PRINT TAB(16);"That disk is not ready.  Check drive and try again.";:RESUME 4100 ELSE 5010
5070 BEEP:AR=CSRLIN:IF ERR<>27 AND ERR<>25 THEN 5010 ELSE LOCATE 24,15:PRINT "The printer is not ready.  Check before proceeding.";:LOCATE 25,25:PRINT "Press any key to continue:";
5075 A$=INKEY$:IF A$="" THEN 5075 ELSE FOR ZZ=24 TO 25:LOCATE ZZ,10:PRINT TAB(80):NEXT:LOCATE AR,1:RESUME
key to continue:";
5075 A$=INKEY$:IF A$="" T