5 CLOSE
10 REM
20 REM
30 REM
40 REM
50 REM
60 REM
70 REM
80 REM 
90 REM
100 REM
110 CL$=CHR$(26):RE$=CHR$(13):BS$=CHR$(8):BU$=CHR$(19)
115 REM
120 EK$=CHR$(27):BE$=CHR$(7)
125 US$="_":BL$=" ":NU$=""
130 SC=1:PR=2:F1=3:F2=4
140 PS=66:TM=5:SW=70
145 REM
160 OU=SC
220 ON ERROR GOTO 41600
650 GOTO 2000
651 REM
660 REM
670 REM
675 REM
680 REM
690 EC$=NU$:T$=WW$
691 FD$=BL$
692 IF WR$<>"WRAP" THEN FOR N=1 TO LN:PRINT US$;:NEXT
693 IF WR$<>"WRAP" THEN FOR N=1 TO LN:PRINT BS$;:NEXT:FD$=US$
695 PRINT WW$;
700 C=LEN(WW$):WW$=NU$
705 C=C+1:C$=INPUT$(1)
706 IF C$=BU$ THEN C$=BS$
725 IF C$=RE$ AND TI$="TIME" THEN PRINT BL$:PRINT:PRINT:TI$=NU$:GOTO 780
729 IF C$=EK$ THEN EC$="ESC": GOTO 780
730 IF C$=RE$ THEN PRINT :GOTO 780
735 IF ((ASC(C$)<FC)OR(ASC(C$)>LC)) AND C$<>BS$ THEN C=C-1: GOTO 705
740 IF C$=BS$ AND C=1 THEN GOTO 700
743 PRINT C$;
745 IF C$=BS$ AND C=2 THEN T$=NU$:GOTO 700
758 IF C$=BS$ AND C>2 THEN C=C-2:T$=LEFT$(T$,C):GOTO 705
760 IF C=LN AND TI$="TIME" THEN PRINT:PRINT:PRINT:T$=T$+C$:TI$=NU$:GOTO 780
761 IF C=LN AND WR$<>"WRAP" THEN T$=T$+C$:GOTO 780
765 IF C>=LN AND C$=BL$ THEN PRINT :GOTO 780
770 IF C>LN AND C$<>BL$ THEN T$=T$+C$:GOSUB 790:GOTO 780
775 T$=T$+C$:GOTO 705
780 WR$=NU$
785 RETURN
790 REM
795 REM
800 REM
805 REM
810 LN=LN+1
815 C=LN:WW$=NU$
820 C=C-1:C$=MID$(T$,C,1)
822 PRINT BL$;BS$;BS$;
825 IF C$=BL$ THEN PRINT FD$;BS$:WW$=RIGHT$(T$,LN-C):T$=LEFT$(T$,C):GOTO 845
830 IF C>1 THEN GOTO 820
840 IF LEN(T$)>=LN THEN T$=LEFT$(T$,LN):PRINT
845 RETURN
850 REM
900 REM
910 REM
915 REM
920 UP$=NU$
930 FOR N=1 TO LEN(LW$)
940    C$=MID$(LW$,N,1)
950    IF C$>"Z" THEN C$=CHR$(ASC(C$)-32)
960    UP$=UP$+C$
970 NEXT
980 RETURN
2000 REM *** DECLARATIONS, continued from line 650 ***
2008 REM *** ARRAY DECLARATIONS ***
2009 OPTION BASE 1
2010 BS=50:FL=40
2040 DIM L$(BS), L2$(BS):REM text buffers
2045 DIM FT$(FL):REM file index table
2050 REM
2055 DIM C(28)
2060 DIM MS(12):REM month sizes
2065 DIM MN$(12)
2070 DIM DN$(7)
2075 DIM FV(3),LV(3),FE$(3)
2080 REM
2085 REM
2086 REM
2087 REM
2111 REM
2140 F$=NU$:OF=1:GOSUB 5600
2145 IF CH$="W" THEN GOSUB 2800:GOTO 2140
2150 IF CH$="F" THEN GOSUB 3850:GOTO 2140
2155 IF CH$="A" THEN GOSUB 27900:GOTO 2140
2160 IF CH$="C" OR CH$="I" THEN DE$="PROGRAM":GOSUB 41555 
2165 IF CH$="C" THEN PRINT CL$:FOR N=1 TO 11:PRINT:NEXT:PRINT TAB(14);"Getting calculator...":CHAIN "CALC-DM.BAS"
2175 IF CH$="I" THEN CHAIN "DDISK-DM.BAS"
2180 IF CH$="Q" OR CH$=EK$ THEN GOTO 2200
2190 ME$="Choice not on the menu"
2195 GOTO 2140
2200 PRINT CL$:END
2750 REM
2800 REM
2950 PR$="memo":TY$=".MEM"
3150 OF=2: GOSUB 5600
3200 IF CH$="E" THEN NM$="NUMBER":GOSUB 6800:GOTO 3150
3250 IF CH$="C" THEN GOSUB 37450:GOTO 3150
3300 IF CH$="P" THEN GOSUB 11950:GOTO 3150
3350 IF CH$="S" THEN GOSUB 17500:GOTO 3150
3400 IF CH$="R" THEN GOSUB 19400:GOTO 3150
3450 IF CH$="L" THEN GOSUB 13850:GOSUB 16850:GOTO 3150
3500 IF CH$="D" THEN GOSUB 21150: GOTO 3150
3600 IF CH$="Q" OR CH$=EK$ THEN GOTO 3610
3605 ME$="Choice not on the menu"
3607 GOTO 3150
3610 IF T=0 THEN GOTO 3750
3620 PRINT CL$ 
3623 PRINT "In case you haven't already, would you like"
3624 PRINT "to save your memo in a disk file before the"
3630 PRINT "buffer is erased? ";
3635 LW$=INPUT$(1):GOSUB 900:K$=UP$
3640 IF K$<>"N" THEN CH$="S": GOTO 3350
3650 T=0:ME$="Buffer erased"
3750 RETURN
3799 REM
3800 REM
3850 REM
4000 TY$=".CDX"
4150 OF=3:GOSUB 5600
4190 PR$="file"
4200 IF CH$="C" THEN GOSUB 22200:GOTO 4150
4250 PR$="card"
4300 IF CH$="A" THEN GOSUB 40250:GOTO 4150 
4350 IF CH$="F" THEN GOSUB 4800:GOTO 4150
4400 PR$="file"
4450 IF CH$="D" THEN GOSUB 21150:GOTO 4150
4500 IF CH$="L" THEN GOSUB 13850:GOSUB 16850:GOTO 4150
4550 IF CH$="Q" OR CH$=EK$ THEN GOTO 4700
4600 ME$="Choice not on the menu"
4650 GOTO 4150
4700 RETURN
4750 REM
4799 REM
4800 REM
5000 OP$=NU$
5150 OF=4:GOSUB 5600 REM MENU GENERATOR
5200 IF CH$="D" THEN OP$="DISPLAY"
5250 IF CH$="E" THEN OP$="DELETE"
5300 IF CH$="P" THEN OP$="PRINT"
5350 IF CH$="D" OR CH$="E" OR CH$="P" THEN GOSUB 24650:GOTO 5150
5400 IF CH$="Q" OR CH$=EK$ THEN GOTO 5500
5450 ME$="Choice not on menu":GOTO 5150
5500 RETURN
5549 REM
5550 REM
5600 REM
5650 REM IMPORT: ME$,DATA  
5750 REM EXPORT: CH$,EC$
5800 REM 
5900 PRINT CL$
5950 IF ME$<>NU$ THEN PRINT "*** ";ME$;" ***"
6000 IF ME$<>NU$ THEN PRINT
6050 ME$=NU$
6100 RESTORE
6150 PRINT:PRINT
6200 N=0
6250 N=N+1
6300    READ OM
6350    FOR O=1 TO OM
6400       READ O$
6450       IF N=OF THEN PRINT SPC(14);O$:PRINT
6500    NEXT
6550 IF N<>OF THEN GOTO 6250
6600 PRINT:PRINT "Select one of the above: "; 
6650 LW$=INPUT$(1):GOSUB 900:CH$=UP$
6700 RETURN
6750 REM
6751 REM
6800 REM
6900 REM
6950 REM
7000 REM
7010 IF T=0 OR TY$<>".MEM" THEN GOTO 7050
7020    PRINT:PRINT:PRINT "Okay to erase memo currently in buffer? ";
7025    LW$=INPUT$(1):GOSUB 900:K$=UP$
7030    IF K$<>"Y" THEN ME$="Canceled":GOTO 7950
7050 EC$=NU$:WW$=NU$
7150 PRINT CL$
7200 PRINT "Enter your ";PR$;":":PRINT
7250 PRINT "Hit the ESC key when you are finished.":PRINT
7300 LN=SW
7350 IF TI$="TIME" THEN PRINT "Enter a valid such as like 7:30 AM,":PRINT "Time (HH:MM AM/PM): ";
7400 L=0
7450 L=L+1:REM for each input line
7500    IF NM$="NUMBER" THEN GOSUB 10000
7550    WR$="WRAP":LN=SW
7560    IF TI$="TIME" THEN WR$=NU$:LN=8
7600    FC=32:LC=127:GOSUB 660
7650    L$(L)=T$
7700    IF EC$="ESC" THEN GOTO 7850
7750 IF L<BS THEN GOTO 7450
7800 IF L=BS THEN ME$="Text buffer full"
7850 T=L
7900 NM$=NU$
7950 RETURN
7975 REM
8000 REM
10000 REM
10025 REM
10030 REM
10050 MA$=BL$+STR$(L)+BL$
10100 IF L>9 THEN MA$=STR$(L)+BL$
10150 PRINT MA$;
10200 RETURN
10225 REM
10250 REM
10300 REM
10450 PRINT "Line to change ";
10500 EC$=NU$
10600 GD$="NN":FV(1)=1:LV(1)=T:GOSUB 26500
10650 IF EC$="ESC" THEN GOTO 11150
10700 L=VAL(FE$(1))
10750 IF L<1 OR L>T THEN PRINT "No line with that number!":GOTO 10300
10800 PRINT:PRINT:PRINT:PRINT
10950 PRINT:PRINT "Hit (ESC) or (RETURN) when finished:":PRINT
11000 GOSUB 10000:REM NUMBER MARGIN
11050 LN=SW:FC=32:LC=127:GOSUB 660:L$(L)=T$
11150 RETURN
11151 REM
11152 REM
11250 REM
11300 REM IMPORT: L$(),T,OU
11400 REM EXPORT: ME$
11500 MA$=NU$
11550 IF OU=F1 OR OU=F2 THEN PRINT #OU,T
11575 IF ME$<>NU$ THEN GOTO 11850 
11600 FOR L=1 TO T
11650    IF NM$="NUMBER" THEN GOSUB 10000
11700    IF OU=F1 OR OU=F2 THEN PRINT #OU,L$(L)
11705    IF ME$<>NU$ THEN GOTO 11850
11710    IF OU=SC THEN PRINT L$(L)
11720    IF OU=PR THEN LPRINT L$(L)
11730    IF (INT(L/20)=L/20) AND OU=SC THEN GOSUB 16850:PRINT:PRINT
11750 NEXT
11800 OU=SC:NM$=NU$
11850 RETURN
11900 REM
11901 REM 
11950 REM
12000 REM
12100 PRINT CL$
12200 IF T=0 THEN ME$="Nothing to print":GOTO 12500
12225 FOR N=1 TO 11:PRINT:NEXT
12250 PRINT SPC(13);"Make sure the printer is on...":PRINT:PRINT:PRINT
12260 IF TY$=".MEM" THEN FOR N=1 TO TM:LPRINT:NEXT
12300 OU=PR:GOSUB 11250:REM PUT TEXT
12400 IF TY$=".MEM" THEN FOR N=1 TO PS-T-TM:LPRINT:NEXT
12500 RETURN
12550 REM
12551 REM
12600 REM
12650 REM
12700 REM
12800 DE$="DATA":GOSUB 41555
12850 OPEN "O",#F1,FI$
12950 FOR F=1 TO FL
13000   PRINT #F1,FT$(F)
13050 NEXT
13100 CLOSE #F1
13150 RETURN
13200 REM
13201 REM
13250 REM
13350 REM
13400 REM
13500 REM
13550 IF EX<>0 THEN GOTO 13750
13600 FT$(L3)=F$
13605 IF L3<>FL THEN FT$(L3+1)="0L"
13650 L3=L3+1
13700 GOSUB 12600
13750 RETURN
13800 REM
13801 REM
13850 REM
13900 REM
13950 REM
14050 REM
14100 EC$=NU$
14200 IF TY$=".MEM" THEN FI$="MEMINDEX"
14250 IF TY$=".CDX" THEN FI$="CDXINDEX"
14300 IF TY$=".APT" THEN FI$="APTINDEX"
14350 DE$="DATA":GOSUB 41555
14400 IF TY$<>".APT" THEN PRINT CL$;PR$;"s on disk:"
14450 PRINT:PRINT
14500 OPEN "I",#F1,FI$
14600 L3=FL+1
14650 FOR F=1 TO FL
14700    LINE INPUT #F1,FT$(F)
14750    IF FT$(F)<>"0N" AND FT$(F)<>"0L" AND TY$<>".APT" THEN PRINT FT$(F)
14800    IF FT$(F)="0L" THEN L3=F
14850 NEXT
14900 IF L3=1 AND TY$<>".APT" THEN PRINT "No ";PR$;"s";" yet.":PRINT:PRINT
14950 CLOSE #F1
15050 RETURN
15100 REM
15101 REM
15150 REM
15200 REM
15250 REM
15300 REM
15400 EX=0: REM Default 0 for non-existence of file
15450 FOR F=1 TO L3-1
15500   IF F$=FT$(F) THEN EX=F
15550 NEXT
15575 RETURN
15600 REM
15700 REM
15750 REM
15800 REM
15900 REM
15950 EC$=NU$:ME$=NU$
16000 GOSUB 13850
16010 IF ME$<>NU$ THEN GOTO 16750
16050 IF F$<>NU$ THEN PRINT:PRINT:PRINT "Do you want the ";F$;" ";PR$;"? ";: LW$=INPUT$(1):GOSUB 900:K$=UP$:PRINT:PRINT
16100 IF K$=EK$ THEN EC$="ESC":GOTO 16750
16150 IF K$<>"N" AND F$<>NU$ THEN GOTO 16500
16200 PRINT:PRINT:PRINT "Enter a ";PR$;" name: ";
16250 WR$=NU$
16300 LN=8:FC=32:LC=127:GOSUB 660
16350 IF EC$="ESC" OR T$=NU$ THEN EC$="ESC":GOTO 16750
16400 LW$=T$:GOSUB 900:F$=UP$:C$=LEFT$(F$,1)
16450 IF C$<"A" OR C$>"Z" THEN PRINT "(First character must be a letter).":PRINT BE$;"Please try again...";:GOTO 16200
16500 GOSUB 15150: REM  FILE EXISTS
16550 PRINT:PRINT:PRINT
16600 IF (CF$="SHOULD BE" OR CF$="NO MATTER") AND EX=0 THEN ME$="No such file"
16650 IF (CF$="SHOULDN'T BE" OR CF$="NO MATTER") AND EX>0 THEN PRINT TAB(18);:PRINT "Overwrite ";F$;"? ";:LW$=INPUT$(1):GOSUB 900:K$=UP$:IF K$<>"Y" THEN ME$="Canceled"
16750 RETURN
16800 REM
16801 REM
16850 REM
16950 PRINT:PRINT:PRINT
17000 PRINT "Hit any key to continue...";
17050 K$=INPUT$(1)
17100 RETURN
17150 REM
17151 REM
17200 REM
17250 PRINT CL$
17300 FOR N=1 TO 11:PRINT:NEXT
17350 PRINT SPC(15);"Please wait"
17400 RETURN
17450 REM
17451 REM
17500 REM
17600 EC$=NU$
17700 IF T=0 THEN ME$="Nothing to save": GOTO 18400
17750 CF$="SHOULDN'T BE":GOSUB 15700
17775 IF L3-1=FL AND EX=0 THEN ME$="No more "+PR$+"s allowed":GOTO 22950
17800 IF EC$="ESC" THEN ME$="Canceled": GOTO 18400
17850 IF ME$<>NU$ THEN GOTO 18400
17900 GOSUB 17200
17950 PRINT:PRINT SPC(18);"Writing"
17975 DE$="DATA":GOSUB 41555
18000 OPEN "O",#F1,F$+TY$
18050 IF ME$<>NU$ THEN CLOSE #F1:GOTO 18400
18100 OU=F1:GOSUB 11250
18150 CLOSE #F1
18200 IF ME$<>NU$ THEN GOTO 18400 
18250 ME$="Saved as: "+F$
18300 GOSUB 13250
18400 RETURN
18450 REM
18451 REM
18500 REM
18550 REM
18600 REM
18700 ED$=NU$
18850 IF EOF(OU) THEN ED$="EOF":GOTO 19100
18900    INPUT #OU,T
18950    FOR L=1 TO T
19000       LINE INPUT #OU,L$(L)
19050    NEXT
19100 OU=SC
19300 RETURN
19350 REM
19351 REM
19400 REM
19500 EC$=NU$
19600 CF$="SHOULD BE":GOSUB 15700
19650 IF EC$="ESC" THEN ME$="Canceled":GOTO 20200
19750 GOSUB 17200:REM  WAIT MESSAGE
19800 PRINT:PRINT SPC(18);"Reading"
19825 DE$="DATA":GOSUB 41555
19850 OPEN "I",#F1,F$+TY$
19950 OU=F1:GOSUB 18500
20000 CLOSE #F1
20100 ME$=F$+" retreived"
20200 RETURN
20250 REM
20251 REM
20300 REM
20400 REM
20500 REM
20550 EC$=NU$
20650 IF EX=FL THEN FT$(FL)="0L": GOTO 20950
20700 FOR F=EX TO FL-1
20750    FT$(F)=FT$(F+1)
20800 NEXT
20850 IF FT$(FL-1)="0L" OR FT$(FL-1)="0N" THEN FT$(FL)="0N"
20900 IF FT$(FL-1)<>"0L" AND FT$(FL-1) <> "0N" THEN FT$(FL)="0L"
20950 L3=L3-1
21000 GOSUB 12600
21050 RETURN
21100 REM
21101 REM
21150 REM
21250 EC$=NU$
21300 CF$="NO MATTER"
21350 IF TY$=".APT" THEN GOTO 21650
21400 GOSUB 15700
21450 IF EC$="ESC" THEN ME$="Canceled": GOTO 22150
21500 IF ME$<>NU$ THEN GOTO 22150
21550 GOSUB 17200
21600 PRINT : PRINT SPC(17);"Deleting"
21625 DE$="DATA":GOSUB 41555
21650 KILL F$+TY$
21700 GOSUB 20300
21725 IF ME$<>NU$ THEN GOTO 22150
21750 PRINT CL$:FOR N=1 TO 9:PRINT:NEXT
21800 IF TY$=".APT" THEN GOTO 22150
21850 PRINT PR$;": ";F$;" deleted.":PRINT:PRINT
21950 PRINT "Delete another? ";:LW$=INPUT$(1):GOSUB 900:K$=UP$
22000 IF K$="Y" THEN GOTO 21350
22050 IF K$=EK$ THEN ME$="Canceled"
22150 RETURN
22155 REM
22160 REM
22200 REM
22250 REM
22300 REM
22450 EC$=NU$
22550 CF$="SHOULDN'T BE":GOSUB 15700
22575 IF L3-1=FL AND EX=0 THEN ME$="No more "+PR$+"s allowed":GOTO 22950
22600 IF EC$="ESC" THEN ME$="Canceled":GOTO 22950
22650 DE$="DATA":GOSUB 41555
22750 OPEN "O",#F1,F$+TY$:CLOSE #F1
22800 IF ME$<>NU$ THEN GOTO 22950
22900 GOSUB 13250
22905 IF ME$<>NU$ THEN GOTO 22950
22910 ME$="Created "+F$
22920 IF EX<>0 THEN ME$="Cleared "+F$
22950 RETURN
23000 REM
23001 REM
23050 REM
23100 REM
23150 REM
23155 ED$=NU$
23160 FOR L=1 TO T:L2$(L)=L$(L):NEXT:T2=T
23200 DE$="DATA":GOSUB 41555
23250 OPEN "O",#F2,"TEMP"
23300 OPEN "I",#F1,F$+TY$
23350    OU=F1:GOSUB 18500
23400    IF ED$="EOF" THEN GOTO 23500
23450    OU=F2:GOSUB 11250:GOTO 23350
23475    IF ME$<>NU$ THEN CLOSE :GOTO 23651
23500 FOR L=1 TO T2:L$(L)=L2$(L):NEXT:T=T2
23550 OU=F2:GOSUB 11250
23600 CLOSE #F1,#F2
23605 IF ME$<>NU$ THEN GOTO 23651
23610 KILL F$+TY$:NAME "TEMP" AS F$+TY$
23650 ME$="Appended to "+F$+" file"
23651 RETURN
23700 REM
23701 REM
23750 REM
23800 REM
23850 REM
24100 GI$=NU$
24150 IF KE$="*" THEN GI$="GOT IT":GOTO 24550
24200 IF FU$="ORDER" AND K2$>KE$ THEN GI$="GOT IT":GOTO 24550
24250 IF FU$="ORDER" AND K2$<=KE$ THEN GOTO 24550
24300 L=0
24350 L=L+1
24400    IF L$(L)=KE$ THEN GI$="GOT IT":GOTO 24550
24450 IF L<T THEN GOTO 24350
24550 FU$=NU$:RETURN
24600 REM
24601 REM
24650 REM
24700 EC$=NU$
24850 FO$="NOT FOUND"
24900 PR$="file"
24950 CF$="SHOULD BE":IF TY$<>".APT" THEN GOSUB 15700
25000 IF TY$=".APT" THEN GOTO 25150
25100 IF EC$="ESC" THEN ME$="Canceled":GOTO 26400
25150 IF ME$<>NU$ THEN GOTO 26400
25175 DE$="DATA":GOSUB 41555
25200 OPEN "I",#F1,F$+TY$
25250 IF OP$="DELETE" THEN OPEN "O",#F2,"TEMP"
25275 IF ME$<>NU$ THEN CLOSE:GOTO 26400
25300 IF TY$=".APT" THEN GOTO 25700
25350 PRINT CL$:FOR N=1 TO 7:PRINT:NEXT
25400 PRINT "Enter a key line to search for, below: "
25425 PRINT "(To match all cards, just type an '*')":PRINT
25450 LN=SW:FC=32:LC=127:GOSUB 660
25500 IF EC$="ESC" THEN ME$="Canceled":GOTO 26400
25550 KE$=T$
25700 OU=F1:GOSUB 18500
25750 IF ED$="EOF" THEN GOTO 26150
25800 GOSUB 23750: REM MATCH
25850 IF GI$<>"GOT IT" AND OP$="DELETE" THEN OU=F2:GOSUB 11250:GOTO 25700
25875 IF ME$<>NU$ THEN CLOSE:GOTO 26400
25900 IF GI$<>"GOT IT" THEN GOTO 25700
25950 FO$="FOUND"
26000 IF OP$="DISPLAY" THEN PRINT:GOSUB 11250:PRINT
26050 IF OP$="PRINT" THEN LPRINT:GOSUB 11950:LPRINT
26100 GOTO 25700: REM END WITH EOF(F1)
26150 IF FO$="NOT FOUND" THEN ME$="Not found"
26200 IF FO$="FOUND" AND TY$<>".APT" AND OP$="DISPLAY" THEN GOSUB 16850
26250 CLOSE #F1
26275 IF OP$="DELETE" THEN CLOSE #F2
26300 IF OP$="DELETE" THEN KILL F$+TY$:NAME "TEMP" AS F$+TY$
26350 IF TY$<>".APT" AND OP$="DELETE" THEN ME$="Matched cards deleted"
26400 OU=SC:RETURN
26450 REM
26500 REM
26550 REM
26700 REM
26850 EC$=NU$
26950 N=LEN(GD$)
27000 PRINT US$;US$;:N=N-2
27050 IF N<>0 THEN PRINT "/";:N=N-1:GOTO 27000
27100 FOR N=1 TO LEN(GD$):PRINT BS$;:NEXT
27150 F=0
27200 F=F+1
27350    WR$=NU$:LN=2:FC=48:LC=57:GOSUB 660
27400    IF EC$="ESC" THEN GOTO 27700
27450    N=VAL(T$):FE$(F)=T$
27500    IF LEN(T$)<2 THEN FE$(F)="0"+T$
27550    IF N<FV(F) OR N>LV(F) THEN PRINT:PRINT "Bad value, try again...":GOTO 26950
27600 IF F<((LEN(GD$)-INT(LEN(GD$)/3))/2) THEN PRINT "/";:GOTO 27200
27650 IF RIGHT$(GD$,2)="YY" THEN FE$(F)="19"+FE$(F)
27700 RETURN
27750 REM
27751 REM
27850 REM
27900 PRINT CL$
27950 RESTORE
28000 REM Skip past menus
28050 FOR N=1 TO 4
28100    READ OM 
28150    FOR O=1 TO OM:READ O$:NEXT
28200 NEXT
28250 REM
28300 FOR N=1 TO 28:READ C(N):NEXT
28350 FOR N=1 TO 12:READ MS(N):NEXT
28400 FOR N=1 TO 12:READ MN$(N):NEXT
28450 FOR N=1 TO 7:READ DN$(N):NEXT
28550 EC$=NU$:PR$="appointment":TY$=".APT"
28650 REM
28700 FOR N=1 TO 11:PRINT:NEXT
28710 PRINT "So that past appointments can be erased,"
28740 PRINT
28750 PRINT "please enter the current date: ";
28800 GD$="MM/DD/YY"
28850 FV(1)=1:FV(2)=1:FV(3)=61
28900 LV(1)=12:LV(2)=31:LV(3)=99:GOSUB 26500
28950 IF EC$="ESC" THEN GOTO 35900
29000 F2$="C"+RIGHT$(FE$(3),2)+FE$(1)+FE$(2)
29050 GOSUB 13850
29075 IF ME$<>NU$ THEN GOTO 35900
29100 X=1
29150    IF X>=L3 THEN GOTO 29300
29170 REM
29200 IF F2$>FT$(X) THEN F$=FT$(X):GOSUB 15150:GOSUB 21150:GOTO 29100
29250 X=X+1:GOTO 29150
29300 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
29350 PRINT "Display or print (D/P)? ";
29400 LW$=INPUT$(1):GOSUB 900:CH$=UP$:IF CH$=EK$ THEN GOTO 35900
29425 CP$="DISPLAY"
29450 IF CH$="P" THEN CP$="PRINT":OU=PR
29650 REM
29700 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
29750 PRINT "Enter month and year to view: ";
29850 GD$="MM/YY":FV(1)=1:LV(1)=12
29900 FV(2)=61:LV(2)=99:GOSUB 26500
29950 IF EC$="ESC" THEN GOTO 35900
30000 MM=VAL(FE$(1)):YY=VAL(FE$(2))
30050 MM$=FE$(1):YY$=FE$(2)
30100 PRINT CL$:FOR N=1 TO 9:PRINT:NEXT
30200 PRINT SPC(13);"Hold on":PRINT:PRINT:PRINT TAB(10);"I'm counting..."
30350 REM
30400 REM
30450 YI=YY-1959
30500 IF YI>28 THEN YI=YI-28:GOTO 30500
30550 CA=C(YI)
30600 REM
30650 MO$=MN$(MM)
30700 REM
30750 IF CA>7 THEN MS(2)=29
30900 FD=CA:REM first day of year
30950 IF CA>7 THEN FD=CA-7
31000 WD=FD:REM week day counter, (modulo 7)
31050 REM
31100 M=0
31150 M=M+1
31200    IF M=MM THEN GOTO 31700
31250    MD=0 
31300    MD=MD+1
31350       WD=WD+1
31400       IF WD>7 THEN WD=1
31500 IF MD<MS(M) THEN GOTO 31300
31550 IF M<MM THEN GOTO 31150
31700 REM
31710 DW=WD
31750 PRINT CL$:PRINT:PRINT
31775 IF OU=PR THEN LPRINT:LPRINT
31800 PRINT SPC(26);MN$(MM):PRINT
31825 IF OU=PR THEN LPRINT SPC(16);MN$(MM):LPRINT
31850 FOR D=1 TO 7:PRINT SPC(4);DN$(D);
31860    IF OU=PR THEN LPRINT SPC(4);DN$(D);
31875 NEXT
32000 PRINT:IF OU=PR THEN LPRINT
32050 PRINT STRING$(79,"-")
32060 IF OU=PR THEN LPRINT STRING$(79,"-")
32150 PRINT SPC(11*(WD-1)-3);:IF OU=PR THEN LPRINT SPC(11*(WD-1)-3);
32200 MD=0:N=0
32250 MD=MD+1:CO$=NU$
32299 MD$=STR$(MD):MD$=RIGHT$(MD$,LEN(MD$)-1)
32300 IF MD<10 THEN MD$="0"+MD$
32350 F$="C"+RIGHT$(YY$,2)+MM$+MD$:GOSUB 15150
32400 IF MD>9 THEN S=9
32450 IF MD<=9 THEN S=10
32500 IF EX<>0 THEN N=1:CO$=":"
32525 IF WD=1 THEN N=N+3
32550 PRINT SPC(S-N);:IF OU=PR THEN LPRINT SPC(S-N);
32575 IF WD=1 THEN N=N-3
32650 PRINT CO$;RIGHT$(STR$(MD),LEN(STR$(MD))-1);CO$;:IF OU=PR THEN LPRINT CO$;RIGHT$(STR$(MD),LEN(STR$(MD))-1);CO$;
32700 IF N=1 AND EX=0 THEN N=0
32750 WD=WD+1
32800 IF WD>7 THEN WD=1:PRINT:PRINT:IF OU=PR THEN LPRINT:LPRINT
32850 IF MD<MS(M) THEN GOTO 32250
32900 PRINT:PRINT:IF OU=PR THEN LPRINT:LPRINT
32950 PRINT STRING$(79,"-")
32960 IF OU=PR THEN LPRINT STRING$(79,"-")
33000 REM
34450 REM
34500 GOSUB 34720
34501 IF EC$="ESC" THEN OU=SC:CP$="DISPLAY":GOTO 29700
34505 IF L3-1=FL AND EX=0 THEN PRINT CL$:FOR N=1 TO 5:PRINT:NEXT:PRINT "No more appointment days allowed...":PRINT:PRINT "Either use another data disk, or erase":PRINT "some old appointments.":GOSUB 16850:WD=DW:GOTO 31700
34510 GOSUB 34779
34550 PRINT "(M)ake or (D)elete appointment or (ESC) to quit? ";
34560 LW$=INPUT$(1):GOSUB 900:CH$=UP$
34600 IF CH$="M" THEN GOSUB 35050:GOTO 34510
34650 IF CH$="D" THEN GOSUB 34900:GOTO 34510
34700 IF CH$=EK$ THEN WD=DW:CP$=NU$:GOTO 31700
34710 PRINT "Bad choice,try again...":GOTO 34550
34715 REM
34720 REM
34725 REM
34730 PRINT "To view, make, or delete appointments, enter"
34740 PRINT "the appropriate day. Hit (ESC) to quit."
34745 PRINT : PRINT "Which day? ";
34750 GD$="DD":FV(1)=1:LV(1)=MS(M):GOSUB 26500
34755 IF EC$="ESC" THEN GOTO 34777
34760 DA=VAL(FE$(1))
34765 F$="C"+RIGHT$(YY$,2)+MM$+FE$(1)
34770 GOSUB 13850
34775 GOSUB 15150
34777 RETURN
34778 REM
34779 REM
34780 PRINT CL$:GOSUB 15150
34785 IF EX=0 THEN PRINT "No appointments for: ";MN$(M);" ";STR$(DA);", ";YY$:PRINT:PRINT:PRINT:GOTO 34860
34800 OPEN "I",#F1,F$+TY$
34802 IF CP$="PRINT" THEN OU=PR
34805 PRINT "Appointments for: ";MN$(M);" ";STR$(DA);", ";YY$
34807 PRINT STRING$(79,"-")
34815 IF OU=PR THEN LPRINT "Appointments for: ";MN$(M);" ";STR$(DA);", ";YY$
34817 IF OU=PR THEN LPRINT STRING$(79,"-")
34820 OU=F1:GOSUB 18500
34825 IF ED$="EOF" THEN GOTO 34843
34827 IF CP$="PRINT" THEN OU=PR
34830 PRINT:IF OU=PR THEN LPRINT
34835 GOSUB 11250
34837 IF ME$<>NU$ THEN GOTO 34860
34840 GOTO 34820
34843 IF CP$="PRINT" THEN OU=PR
34845 PRINT STRING$(79,"="):PRINT:PRINT
34846 IF OU=PR THEN LPRINT STRING$(79,"="):LPRINT:LPRINT
34848 OU=SC
34850 CLOSE #F1
34860 RETURN
34869 REM
34900 REM
34910 PRINT:PRINT:PRINT "Enter appointment time: ";:LN=8:FC=32:LC=127:GOSUB 660:IF EC$="ESC" THEN GOTO 34940
34920 KE$=T$:OP$="DELETE":GOSUB 24650
34922 IF ME$<>NU$ THEN GOTO 34940
34925 IF FO$="NOT FOUND" THEN PRINT "Appointment ";ME$:ME$=NU$:FOR X=1 TO 200:NEXT
34930 GOSUB 41150
34940 RETURN
34949 REM
35050 REM
35100 TI$="TIME":GOSUB 6800
35150 PRINT:PRINT:PRINT "Would you like to change this? ";
35160 LW$=INPUT$(1):GOSUB 900:K$=UP$:IF K$=EK$ THEN GOTO 35900
35200 IF K$="Y" THEN GOSUB 37450
35275 IF LEFT$(L$(1),1)=BL$ THEN L$(1)=RIGHT$(L$(1),LEN(L$(1))-1)
35300 KE$=LEFT$(L$(1),8)
35350 IF LEN(KE$)=7 THEN KE$="0"+KE$
35400 IF LEFT$(KE$,2)="12" THEN KE$="00"+RIGHT$(KE$,6)
35450 KE$=RIGHT$(KE$,2)+LEFT$(KE$,5)
35490 REM
35500 FOR L=1 TO T:L2$(L)=L$(L):NEXT:T2=T
35700 GOSUB 36000:REM INSERT CARD
35800 IF EX=0 AND ME$=NU$ THEN GOSUB 13250
35900 RETURN
35950 REM
35951 REM
36000 REM
36050 REM
36150 REM
36200 EC$=NU$:NF$=NU$
36300 FO$="NOT FOUND"
36350 DE$="DATA":GOSUB 41555
36400 OPEN "I",#F1,F$+TY$
36450 OPEN "O",#F2,"TEMP"
36475 IF ME$<>NU$ THEN CLOSE:GOTO 37350
36500 IF NF$="NOFILE" THEN NF$=NU$:GOTO 37150 
36550 OU=F1:GOSUB 18500
36600 IF ED$="EOF" THEN GOTO 37150
36650 K2$=LEFT$(L$(1),8)
36700 IF LEN(K2$)=7 THEN K2$="0"+K2$
36800 IF LEFT$(K2$,2)="12" THEN K2$="00"+RIGHT$(K2$,6)
36850 K2$=RIGHT$(K2$,2)+LEFT$(K2$,5)
36950 FU$="ORDER":GOSUB 23750
36960 IF GI$<>"GOT IT" OR FO$<>"NOT FOUND" THEN GOTO 37100
36970    FO$="FOUND"
36980    PRINT #F2,T2:IF ME$<>NU$ THEN CLOSE:GOTO 37350
36990    FOR L=1 TO T2:PRINT #F2,L2$(L):IF ME$<>NU$ THEN GOTO 37350
37000       NEXT:OU=F2:GOSUB 11250 
37010       IF ME$<>NU$ THEN CLOSE:GOTO 37350
37020    GOTO 36550  
37100 OU=F2:GOSUB 11250:IF ME$<>NU$ THEN CLOSE:GOTO 37350  
37110 GOTO 36500
37150 IF FO$<>"NOT FOUND" THEN GOTO 37200
37160    PRINT #F2,T2:IF ME$<>NU$ THEN CLOSE:GOTO 37350
37170    FOR L=1 TO T2:PRINT #F2,L2$(L):IF ME$<>NU$ THEN CLOSE:GOTO 37350
37180       NEXT
37200 CLOSE #F1,#F2
37250 KILL F$+TY$:NAME "TEMP" AS F$+TY$
37350 RETURN
37400 REM
37401 REM
37450 REM
37600 EC$=NU$
37650 IF T=0 THEN ME$="Nothing to change":GOTO 38500
37700 PRINT CL$
37750 IF ME$<>NU$ THEN PRINT "*** ";ME$;" ***"
37800 IF ME$=NU$ THEN PRINT
37850 ME$=NU$
37900 PRINT:PRINT:PRINT
37950 NM$="NUMBER":GOSUB 11250
38000 PRINT:PRINT
38010 PRINT "Change, Insert, Delete, Append, or (ESC) ?";
38020 LW$=INPUT$(1):GOSUB 900:CH$=UP$
38030 PRINT:PRINT
38050 IF CH$="I" AND T=BS THEN ME$="No more space in the buffer":GOTO 37650
38100 IF CH$="C" THEN GOSUB 10300:GOTO 37650
38150 IF CH$="I" THEN GOSUB 38600:GOTO 37650
38200 IF CH$="D" THEN GOSUB 39550:GOTO 37650
38250 IF CH$="A" THEN GOSUB 40700:GOTO 37650
38300 IF CH$=EK$ THEN CH$=NU$:GOTO 38500
38400 ME$="Choice not on menu"
38450 GOTO 37650:REM end with ESC
38500 RETURN
38550 REM
38551 REM 
38600 REM
38700 IF T=BS THEN ME$="Buffer full":GOTO 39450
38750 PRINT "Line below insert: ";
38800 GD$="NN":FV(1)=1:LV(1)=T:GOSUB 26500
38850 IF EC$="ESC" THEN GOTO 39450
38900 I=VAL(FE$(1))
38950 PRINT
39000 FOR L=T+1 TO I+1 STEP -1:L$(L)=L$(L-1):NEXT
39050 GOSUB 10000:REM NUMBER MARGIN
39100 WR$="WRAP":LN=SW:FC=32:LC=127:GOSUB 660
39200 L$(I)=T$:T=T+1
39250 I=I+1
39300 IF EC$="ESC" THEN GOTO 39450
39350 IF T<BS THEN GOTO 39000
39400 IF T=BS THEN ME$="Text buffer full"
39450 RETURN
39500 REM
39501 REM
39550 REM
39650 PRINT "Line to delete: ";
39700 GD$="NN":FV(1)=1:LV(1)=T:GOSUB 26500
39800 IF EC$="ESC" THEN GOTO 40100
39850 D=VAL(FE$(1))
39900 FOR N=D TO T-1:L$(N)=L$(N+1):NEXT
40000 T=T-1
40100 RETURN
40150 REM
40151 REM 
40200 REM
40250 NM$="NUMBER":GOSUB 6800
40300 PRINT:PRINT:PRINT "Would you like to change this card? ";
40325 LW$=INPUT$(1):GOSUB 900:K$=UP$
40330 IF K$="Y" THEN GOSUB 37450
40350 IF K$=EK$ THEN ME$="Canceled":GOTO 40600
40400 CF$="SHOULD BE":PR$="file":GOSUB 15700:PR$="card"
40450 IF EC$="ESC" THEN ME$="Canceled":GOTO 40600
40550 GOSUB 23050: REM APPEND TEXT
40600 RETURN
40650 REM
40651 REM
40700 REM
40800 IF T=BS THEN ME$="Text buffer full":GOTO 41050
40825 T=T+1:L=T
40850 GOSUB 10000
40900 WR$="WRAP":LN=SW:FC=32:LC=127:GOSUB 660
40950 L$(T)=T$
41000 IF EC$<>"ESC" THEN GOTO 40800
41050 RETURN
41100 REM
41101 REM
41150 REM
41200 OPEN "I",#F1,F$+TY$
41350 IF EOF(F1) THEN CLOSE #F1:GOSUB 21150
41500 CLOSE #F1:RETURN
41550 REM
41551 REM
41555 REM
41556 DK$="NOID"
41557 OPEN "I",#F1,"IDENT-DM":INPUT #F1,DK$:CLOSE 
41560 IF DK$="DATA" AND DE$="DATA" THEN GOTO 41595
41561 IF DK$="PROGRAM" AND DE$="PROGRAM" THEN GOTO 41595
41565 PRINT CL$:FOR N=1 TO 7:PRINT:NEXT
41570 PRINT "Insert the Desk Master ";DE$;" disk."
41592 GOSUB 16850:RESET
41593 GOTO 41557
41595 RETURN
41597 REM
41599 REM
41600 REM
41700 IF ERR=53 THEN NF$="NOFILE":RESUME NEXT
41750 IF ERR=61 THEN ME$="Disk Full":RESUME NEXT
41800 IF ERR=57 THEN PRINT "Unrecoverable disk error encountered.  Re-start program.":PRINT "Once Desk Master is running again, do not switch":PRINT "when you are instructed to do so."
41850 IF ERR=64 THEN PRINT "Bad character in file name.  See manual." 
41900 IF ERR=53 THEN PRINT "Check disk, file not found on it." 
41999 ON ERROR GOTO 0 
42349 REM 
42350 REM
42351 REM
42352 REM
42353 REM
42450 REM
42475 REM
42500 DATA 6,"Write Memo                  (W)" 
42550 DATA   "Card File                   (F)"
42600 DATA   "Appointment Calendar        (A)"
42650 DATA   "Calculator                  (C)"
42750 DATA   "Initiate Data Disk          (I)"
42800 DATA   "Quit Desk Master Program   (ESC)"
42850 REM
42900 DATA 8,"Enter Memo                  (E)"
42950 DATA   "Change or View Memo         (C)"
43000 DATA   "Print Memo                  (P)"
43050 DATA   "Save Memo on Disk           (S)"
43100 DATA   "Retrieve Memo from Disk     (R)"
43200 DATA   "Delete Memo from Disk       (D)"
43250 DATA   "List Memo Names from Disk   (L)"
43300 DATA   "Return to Main Menu        (ESC)"
43350 REM
43400 DATA 6,"Create File                 (C)"
43450 DATA   "Add Card to File            (A)"
43500 DATA   "Find Card(s) in File        (F)"
43600 DATA   "Delete File from Disk       (D)"
43650 DATA   "List File Names from Disk   (L)"
43675 DATA   "Return to Main Menu        (ESC)"
43700 REM
43750 DATA 4,"Display Matched Cards       (D)"
43800 DATA   "Erase Matched Cards         (E)"
43850 DATA   "Print Matched Cards         (P)"
43900 DATA   "Return to Card File Menu   (ESC)"
43950 REM
43951 REM
44100 REM
44150 DATA 13,1,2,3,11,6,7,1,9,4,5,6,14,2,3,4,12,7,1,2,10,5,6,7,8,3,4,5
44200 REM
44250 DATA 31,28,31,30,31,30,31,31,30,31,30,31
44300 REM
44350 DATA "January","February","March","April","May"
44400 DATA "June","July","August","September","October"
44450 DATA "November","December"
44500 DATA "Sunday","Monday","Tuesday","Wednesday"
44550 DATA "Thursday","Friday","Saturday"
50000 REM
50100 REM
ecember"
44500 DATA "Sunday","Monday","Tuesday","Wednesday"
4