1 REM MAILPAC  
5 CLEAR  9000 :CLS :P1=1 :DIM  A$(100)  
10 DIM  NL$(100),N1$(100),N2$(100),CO$(100),A1$(100),A2$(100)  
12 PRINT "         MAILING LIST PROGRAM ":PRINT   
15 INPUT "ARE DISK DRIVES ATTACHED(Y/N)";ZD$  
17 IF  ZD$<>"Y"  AND  ZD$<>"N"  THEN  GOSUB  10000:GOTO  15  
20 CLS :PRINT @  10,"**MENU**" :PRINT  :PRINT   
25 PRINT  "TO QUIT TYPE 0  
30 PRINT  "TO BUILD OR ADD TO A FILE TYPE 1  
40 PRINT  "TO SEE THE ENTIRE FILE TYPE 2  
50 PRINT  "TO SEE AN INDIVIDUAL NAME TYPE 3  
60 PRINT  "TO MAKE CORRECTIONS TYPE 4  
70 PRINT  "TO SAVE THE CURRENT FILE ON TAPE TYPE 5  
75 PRINT  "TO SAVE THE CURRENT FILE ON DISKETTE TYPE 6  
80 PRINT  "TO INPUT A FILE FROM TAPE TYPE 7  
82 PRINT  "TO INPUT A FILE FROM DISKETTE TYPE 8  
84 PRINT  "TO PRINT THE ENTIRE FILE (LINE PRINTER) TYPE 9  
85 PRINT  "TO PRINT ALPHABETIZED LIST(LINE PRINTER) TYPE 10  
86 PRINT  "TO PRINT AN INDIVIDUAL NAME (LINE PRINTER) TYPE 11  
90 INPUT  Q 
92 IF Q = 0 THEN END
94 ON  Q GOSUB  100,200,300,400,500,550,600,650,700,800,900  
99 GOTO  20  
100 CLS:PRINT "ADDITION OF NAMES TO FILE.";P1-1;" NAMES ALREADY ON FILE"  
103 INPUT "PRESS 0 TO ADD NAMES, 1 TO END";X  
105 IF  X<>0  AND  X<>1  THEN  GOSUB  10000:GOTO  100  
107 IF  X=1  THEN  RETURN   
110 FOR  I=P1  TO  500 :CLS :PRINT "ENTER MEMBERSHIP #(9999 TO END)  
112 PRINT "THEN HIT THE 'ENTER' KEY" ;:INPUT  NL$(I)  
115 IF  NL$(I)="9999"  THEN  P1=I :I=500:GOTO 140  
117 INPUT "ENTER FIRST NAME"; N1$(I)  
118 INPUT "ENTER LAST NAME"; N2$(I)  
119 INPUT "ENTER COMPANY NAME OR APARTMENT #"; CO$(I)  
120 INPUT "ENTER YOUR ADDRESS"; A1$(I)  
130 INPUT "ENTER CITY,STATE AND ZIP CODE"; A2$(I)  
140 NEXT   
150 PRINT "FILE CLOSED--" :INPUT "TO SEE THE MENU HIT ENTER"; X  
160 RETURN   
200 CLS :FOR  I=1  TO  P1-1   
210 GOSUB  4000  
220 FOR  JJ=1  TO  100:NEXT   
260 NEXT   
270 INPUT "TO SEE THE MENU, HIT ENTER"; X :RETURN   
300 CLS :INPUT "ENTER LAST NAME"; N2$  
310 I=0  
312 I=I+1:IF  N2$=N2$(I)  THEN  GOTO  330  
315 IF  I<P1  THEN  GOTO  312  
320 PRINT "NAME NOT IN FILE" :GOTO 370  
330 GOSUB  4000  
370 INPUT "FOR DUPLICATE NAME TYPE 2,FOR ANOTHER NAME TYPE 1, ELSE 0"; X  
375 IF  X=2  THEN  GOTO  312  
380 IF  X=1 THEN GOTO 300 :  ELSE   RETURN   
400 CLS :PRINT "ENTER THE LAST NAME FOR THE FILE YOU WISH TO CHANGE"  
405 INPUT  N2$  
407 I=0  
410 I=I+1:IF  N2$=N2$(I)  THEN  GOTO  425  
415 IF  I<P1  THEN  GOTO  410  
420 PRINT "NAME NOT IN FILE" :GOTO 460  
425 CLS:GOSUB  4000  
430 PRINT "ENTER THE CORRECTED INFORMATION"  
432 PRINT  :INPUT "MEMBERSHIP #"; NL$(I)  
434 INPUT "FIRST NAME"; N1$(I)  
440 INPUT "LAST NAME"; N2$(I)  
450 INPUT "COMPANY OR APARTMENT #"; CO$(I)  
452 INPUT "STREET ADDRESS"; A1$(I)  
454 INPUT "CITY, STATE AND ZIP CODE"; A2$(I)  
460 INPUT "FOR DUPLICATE NAME TYPE 2,FOR ANOTHER CORRECTION TYPE 1, ELSE 0"; X  
465 IF  X=2  THEN  GOTO  410  
470 IF  X=1  THEN  GOTO  400  
480 RETURN   
500 CLS  
505 PRINT "MAKE PREPARATIONS FOR CASSETTE."  
507 INPUT "WHEN READY HIT ENTER"; X  
510 PRINT "COPYING..."  
515 ' IF  ZD$="Y"  THEN  CMD"T"  
520 WRITE #-1, P1  
525 FOR  I=1  TO  P1  
530 WRITE #-1, NL$(I), N1$(I), N2$(I), CO$(I), A1$(I), A2$(I), A$(I)  
535 NEXT   
540 PRINT "COMPLETE--NOTE TAPE LOCATION"  
545 INPUT "TO SEE THE MENU, HIT ENTER"; X :RETURN   
550 CLS:PRINT "SAVING FILE ON DISKETTE":PRINT   
560 PRINT "PRESENT MAIL FILE NAME IS ";ND$;:INPUT "   NEW NAME ";ND$  
565 PRINT  P1;" ITEMS IN MAILING LIST INCLUDING TRAILER."  
570 INPUT "PRESS ENTER WHEN DISKETTE IS READY";Z9$  
575 OPEN "O",1,ND$  
577 WRITE # 1,P1  
580 FOR  I=1  TO  P1  
585 WRITE # 1, NL$(I), N1$(I), N2$(I), CO$(I), A1$(I), A2$(I), A$(I)  
590 NEXT   
595 CLOSE #1:RETURN   
600 CLS :INPUT "WHEN READY, HIT ENTER"; X  
610 PRINT "INPUTING...  
615 ' IF  ZD$="Y"  THEN  CMD"T"  
620 INPUT #-1, P1  
625 FOR  I=1  TO  P1  
630 INPUT #-1, NL$(I), N1$(I), N2$(I), CO$(I), A1$(I), A2$(I), A$(I)  
635 NEXT   
640 PRINT "COMPLETE":INPUT "TO SEE MENU, HIT ENTER"; X :RETURN   
650 REM READING IN FILE FROM DISKETTE  
655 CLS:PRINT "FILE TO BE READ IN FROM DISKETTE":PRINT   
660 INPUT " ENTER NAME OF FILE TO BE READ ";ND$  
665 OPEN "I",1,ND$  
670 INPUT # 1, P1  
672 PRINT :PRINT  P1-1;" NAMES TO BE INPUT"  
675 FOR  I=1  TO  P1  
680 INPUT # 1, NL$(I), N1$(I), N2$(I), CO$(I), A1$(I), A2$(I), A$(I)  
685 NEXT  I  
690 CLOSE #1:RETURN   
700 CLS :FOR  I=1  TO  P1  
705 LPRINT  NL$(I)  
710 LPRINT  N1$(I);" ";N2$(I)   
720 CO$=CO$(I)   
730 IF  LEN(CO$)>0 THEN LPRINT  CO$   
740 LPRINT  A1$(I)   
750 LPRINT  A2$(I)   
768 LPRINT  " "  
770 IF  LEN(CO$)=0 THEN LPRINT  " "   
780 NEXT   
790 INPUT "TO SEE THE MENU, HIT ENTER"; X:RETURN   
800 N=P1-1  
805 FOR  I=1  TO  N   
810 A$(I)=N2$(I)+N1$(I)  
815 NEXT   
820 CLS :K=0  
825 I=1  
830 FOR  J=2  TO  N  
835 IF  A$(I)<A$(J) THEN GOTO  840 :  ELSE   I=J  
840 NEXT   
845 LPRINT  N2$(I);" ";N1$(I);"-";NL$(I)  
847 A$(I)="ZZ"  
850 K=K+1  
855 IF  K=N THEN GOTO  890 :  ELSE   GOTO  825  
890 PRINT  :INPUT "TO SEE MENU PRESS ENTER"; X :RETURN   
900 CLS :INPUT "ENTER LAST NAME"; N2$  
910 I=0  
912 I=I+1:IF  N2$=N2$(I)  THEN  GOTO  930  
915 IF  I<P1  THEN  GOTO  912  
920 PRINT "NAME NOT IN FILE" :GOTO 970  
930 PRINT  NL$(I);"  ";N1$(I);"   ";N2$(I)  
932 INPUT "PRESS 1 IF CORRECT NAME,ELSE 2";X  
933 IF  X<>1  THEN  GOTO  912  
935 LPRINT  NL$(I)  
940 LPRINT  N1$(I);" ";N2$(I)  
949 CO$=CO$(I)  
950 IF  LEN(CO$)>0 THEN LPRINT  CO$(I)  
955 LPRINT  A1$(I)  
960 LPRINT  A2$(I)  
965 LPRINT  " "  
966 IF  LEN(CO$)=0 THEN LPRINT  " "  
970 PRINT  :PRINT "FOR ANOTHER NAME TYPE 1, OTHERWISE 0" :INPUT  X  
980 IF  X=1 THEN GOTO  900 :  ELSE   RETURN   
4000 REM PRINT INFORMATION ABOUT 1 NAME  
4010 PRINT  NL$(I)  
4020 PRINT  N1$(I);" ";N2$(I)  
4030 CO$=CO$(I)  
4040 IF  LEN(CO$)>0 THEN PRINT  CO$  
4050 PRINT  A1$(I)  
4060 PRINT  A2$(I)  
4099 RETURN   
10000 PRINT "INPUT ERROR! TRY AGAIN!":FOR  JJ=1 TO 400:NEXT :RETURN   

