10 WIDTH 128
20 REM COPYRIGHT (C) 1982-83 BY John Gaudio
30 REM MAY BE REPRODUCED FOR NON COMMERCIAL USE.
40 REM LAST UPDATE 11/04/83 @3:51 PM.
50 REM
60 REM *****************************************
70 REM STORE DATA FROM OLD LIST.LST TO TEMP
80 LET F=1
90 ON ERROR GOTO 810
100 OPEN "I",#1,"B:LIST.LST"
110 REM IF FILE EXISTS, WRITE IT TO "TEMP"
120 OPEN "O", #2,"B:TEMP"
130 IF EOF (1) THEN 170
140 LINE INPUT #1, A$
150 PRINT #2, A$
160 GOTO 130
170 CLOSE #1
180 REM
190 REM *****************************************
200 REM ADD ENTRIES TO NEW FILE
210 PRINT CHR$(26)
220 PRINT "PLEASE ENTER THE INFORMATION REQUESTED."
230 PRINT "WHEN YOU'RE FINISHED JUST ENTER A RETURN"
240 PRINT "FOR NAME."
250 PRINT
260 LINE INPUT "      NAME "; N$
270 IF N$="" THEN 700
280 LINE INPUT "SALUTATION "; SAL$
290 LINE INPUT "   ADDRESS "; SA$
300 LINE INPUT "      CITY "; CITY$
310 LINE INPUT "     STATE "; STATE$
320 LINE INPUT "       ZIP "; Z$
330 LINE INPUT "  PHONE(S) "; PHONE$
340 REM
350 REM *****************************************
360 REM CHECK NEW ENTRIES FOR ACCURACY
370 PRINT 
380 PRINT N$
390 PRINT SA$
400 PRINT CITY$;", ";STATE$;"  "Z$
410 PRINT
420 PRINT "Dear ";SAL$
430 PRINT
440 PRINT "PHONE(S) ";PHONE$
450 PRINT 
460 PRINT
470 LINE INPUT "IS THIS CORRECT? "; H$
480 IF H$="N" THEN 540
490 IF H$="n" THEN 540
500 IF H$="y" THEN 610
510 IF H$="Y" THEN 610
520 PRINT "PLEASE ENTER A Y FOR YES OR AN N FOR NO."
530 GOTO 470
540 PRINT CHR$(26)
550 PRINT "DATA ABANDONED, RE-ENTER";CHR$(7)
560 PRINT
570 GOTO 220
580 REM
590 REM ***************************************** 
600 REM ENTER DATA ON FILE
610 PRINT CHR$(26)
620 PRINT "DATA WILL BE ENTERED ON FILE"
630 PRINT
640 WRITE #2, N$,SAL$,SA$,CITY$,STATE$,Z$,PHONE$
650 PRINT
660 GOTO 220
670 REM
680 REM *****************************************
690 REM DATA ENTRY COMPLETE, CLOSE & RENAME FILES
700 CLOSE
710 IF F=0 GOTO 750
720 ON ERROR GOTO 850
730 KILL "B:LIST.BAK"
740 NAME "B:LIST.LST" AS "B:LIST.BAK"
750 NAME "B:TEMP" AS "B:LIST.LST"
760 GOTO 870
770 REM
780 REM *****************************************
790 REM ERROR RECOVERY SECTION, IE FILES LIST.LST
800 REM OR LIST.BAK DID NOT EXIST  
810 IF ERR<>53 OR ERL<>100 THEN 860  
820 OPEN "O",#2,"B:TEMP"
830 LET F=0
840 RESUME 210
850 IF ERR = 53 THEN RESUME 740
860 PRINT "ERROR ";ERR;" IN LINE ";ERL
870 END
O",#2,"B:TEMP