10 ' ********************************************** 20 ' ********************************************** 30 ' *** K-TEDIT *** 40 ' *** PART OF A CLUB MEMBERSHIP *** 50 ' *** FILING SYSTEM CALLED KEEP-TRAK *** 60 ' *** *** 70 ' *** *** 80 ' *** WRITTEN IN MICROSOFT BASIC-80 REV.5.21 *** 90 ' *** *** 100 ' *** (C) COPYRIGHT 1983 BY HARVEY G. LORD *** 110 ' *** *** 120 ' *** DO NOT ATTEMPT TO RUN THIS PROGRAM *** 130 ' *** ALONE. IT IS CHAINED FROM K-TMENU. *** 140 ' ********************************************** 150 ' ********************************************** 160 ' 170 ON ERROR GOTO 20000 ' Error traps (Ch. 10) 180 COMMON CL$,RECORDTOTAL ' Pass variables to programs (Ch. 11) 190 ' Define cursor control (Ch. 8) 200 DEF FNCUR$(VERT,HORZ) = CHR$(27)+CHR$(61)+CHR$(32+VERT)+CHR$(32+HORZ) 210 DEF FNBIN$ = CHR$(27)+CHR$(41) ' Define begin lowered intensity (Ch. 8) 220 DEF FNNIN$ = CHR$(27)+CHR$(40) ' Define end lowered intensity (Ch. 8) 230 DEF FNCLLN$ = CHR$(27) + CHR$(84) ' Define clear line from cursor (Ch. 8) 240 ' 250 ' 260 ' 270 ' 280 ' 290 ' Check for B:K-T.LST's existence. If it's not there, to error trap 300 OPEN "I",#1,"B:K-T.LST":CLOSE#1 310 ' 320 ' The rest of the program's executed only if B:K-T.LST exists. 330 ' 340 ' Menu: Edit all members or only certain ones. 350 ' 360 PRINT CL$ ' Clear screen (Ch. 7) 370 PRINT:PRINT ' 2 blank lines 380 PRINT TAB(9);"** Change Club Member's Entries **" 390 PRINT:PRINT ' 2 blank lines 400 PRINT "You may look at every entry in the membership list," 410 PRINT "editing as you go" 420 PRINT 430 PRINT TAB(24);"OR" 440 PRINT 450 PRINT "you may let the computer search through the member-" 460 PRINT "ship list for the one (or more) entries you wish to" 470 PRINT "change." 480 PRINT:PRINT ' 2 blank lines 490 PRINT TAB(7);"S - Search for member's entry to edit" 500 PRINT TAB(7);"G - Global editing of all entries" 510 PRINT TAB(7);"R - Return to MAIN MENU" 520 PRINT:PRINT ' 2 blank lines 530 PRINT TAB(14);"Please choose by letter." 540 CHOICE$ = INKEY$:IF CHOICE$ = "" THEN 540 550 IF CHOICE$ = "S" OR CHOICE$ = "s" THEN 1000 560 IF CHOICE$ = "G" OR CHOICE$ = "g" THEN 2000 570 IF CHOICE$ = "R" OR CHOICE$ = "r" THEN PRINT:PRINT:GOTO 2180 580 ' 590 ' 600 ' Catch illegal choices 610 ' 620 PRINT CHR$(7); ' Beep (Ch. 10) 630 FOR COUNT = 1 TO 3 ' Blink "Please choose" (Ch. 8) 640 PRINT FNCUR$(21,8);FNCLLN$ ' Clear line (Ch. 8) 650 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 660 PRINT FNCUR$(21,8);"Please choose 'S,' 'G,' or 'R.' 670 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 680 NEXT COUNT 690 GOTO 540 700 ' 710 ' 720 ' 730 ' 740 ' 1000 ' Search B:K-T.LST for entries to edit (Ch. 6) 1010 ' 1020 FOUNDIT = 0 ' Found no entry; FOUNDIT = 1 means entry is found 1030 OPEN "I",#1,"B:K-T.LST" ' OPEN B:K-T.LST for reading (Ch. 5) 1040 OPEN "O",#2,"B:COPY" ' OPEN B:COPY for writing (Ch. 5) 1050 PRINT CL$ ' Clear screen (Ch. 7) 1060 PRINT " *** Search for and Edit Specific Entries ***" 1070 PRINT:PRINT ' 2 blank lines 1080 PRINT " Enter the first and last names of the person" 1090 PRINT " whose address and telephone number you want to" 1100 PRINT " edit." 1110 PRINT 1120 PRINT " NOTE: Spelling, including upper and lower case" 1130 PRINT " letters, COUNTS." 1140 PRINT 1150 PRINT " Misspelling causes computer errors." 1160 PRINT:PRINT ' 2 blank lines 1170 PRINT " FIRST NAME (then press RETURN):" 1180 PRINT " LAST NAME (then press RETURN):" 1190 PRINT FNCUR$(14,36);FNCLLN$ ' Clear line (Ch. 8) 1200 PRINT FNCUR$(14,36);:LINE INPUT;FIRSTNAME$ 1210 GOSUB 15000:IF ILLEGAL = 1 THEN 1190 ' Check for illegal entry (Ch. 10) 1220 PRINT FNCUR$(15,36);FNCLLN$ ' Clear line (Ch. 8) 1230 PRINT FNCUR$(15,36);:LINE INPUT;LASTNAME$ 1240 GOSUB 16000:IF ILLEGAL = 1 THEN 1220 ' Check for illegal entry (Ch. 10) 1250 PRINT FNCUR$(17,2);"Searching. Please wait." 1260 IF EOF(1) THEN CLOSE#1:GOTO 1370 ' Check for end-of-file (Ch. 3) 1270 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$ 1280 IF FIRSTNM$ <> FIRSTNAME$ OR LASTNM$ <> LASTNAME$ THEN 1350 1290 FOUNDIT = 1 ' Found the entry 1300 PRINT CL$ ' Clear screen (Ch. 7) 1310 PRINT " *** Here's the entry you asked for ***" 1320 GOSUB 3000 ' Display record 1330 GOSUB 4360 ' Edit record 1340 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN 1260 ' Delete record (Ch. 5) 1350 PRINT#2,FIRSTNM$;",";LASTNM$;",";STRTADD$;",";CITY$;",";STATE$;",";ZIP$;",";TELNUMBER$;",";PAID$ 1360 GOTO 1260 ' Loop back for more records 1370 KILL "B:K-T.LST" ' Erase B:K-T.LST 1380 CLOSE#2 ' CLOSE B:COPY 1390 NAME "B:COPY" AS "B:K-T.LST" ' Rename B:COPY back to B:K-T.LST so the rest of KEEP-TRAK can read it. 1400 ' 1410 ' 1420 ' 1430 ' 1440 ' 1450 ' Give opportunity to search for and edit more records 1460 ' 1470 PRINT CL$ ' Clear screen (Ch. 7) 1480 IF FOUNDIT = 0 THEN GOSUB 14000:GOTO 1540 ' Found no entry explanation 1490 PRINT:PRINT ' 2 blank lines 1500 PRINT TAB(11);"** End of Membership List ** 1510 PRINT:PRINT ' 2 blank lines 1520 PRINT " You may now search for and edit another entry or" 1530 PRINT TAB(14);"return to the MAIN MENU." 1540 PRINT:PRINT:PRINT ' 3 blank lines 1550 PRINT TAB(7);"S - Search for another entry to edit" 1560 PRINT TAB(7);"R - Return to MAIN MENU" 1570 PRINT:PRINT:PRINT ' 3 blank lines 1580 PRINT TAB(14);"Please choose by letter." 1590 CHOICE$ = INKEY$:IF CHOICE$ = "" THEN 1590 1600 IF CHOICE$ = "S" OR CHOICE$ = "s" THEN 1000 1610 IF CHOICE$ = "R" OR CHOICE$ = "r" THEN PRINT:PRINT:GOTO 2180 1620 ' 1630 ' Catch illegal choices 1640 ' 1650 PRINT CHR$(7); ' Beep (Ch. 10) 1660 FOR COUNT = 1 TO 3 ' Blink "Please choose" (Ch. 8) 1670 PRINT FNCUR$(16,13);FNCLLN$ ' Clear line (Ch. 8) 1680 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 1690 PRINT FNCUR$(16,13);"Please choose 'S' or 'R.'" 1700 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 1710 NEXT COUNT 1720 GOTO 1590 1730 ' 1740 ' 1750 ' 1760 ' 1770 ' 2000 ' Global Edit - All Records (Ch. 5) 2010 ' 2020 OPEN "I",#1,"B:K-T.LST" ' OPEN B:K-T.LST for reading (Ch. 5) 2030 OPEN "O",#2,"B:COPY" ' OPEN B:COPY for writing (Ch. 5) 2040 PRINT CL$ ' Clear screen (Ch. 7) 2050 IF EOF(1) THEN CLOSE#1:GOTO 2130 ' Check for end-of-file (Ch. 3) 2060 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$ 2070 PRINT TAB(16);"** Edit All Members **" 2080 GOSUB 3000 ' Display & edit record 2090 GOSUB 4360 ' Edit 2100 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN 2040 ' Delete record 2110 PRINT#2,FIRSTNM$;",";LASTNM$;",";STRTADD$;",";CITY$;",";STATE$;",";ZIP$;",";TELNUMBER$;",";PAID$ 2120 GOTO 2040 ' Loop back for next record 2130 KILL "B:K-T.LST" ' Erase B:K-T.LST 2140 CLOSE #2 2150 NAME "B:COPY" AS "B:K-T.LST" 2160 PRINT:PRINT ' 2 blank lines 2170 PRINT TAB(14);"That's the whole file." 2180 PRINT TAB(14);"Returning to MAIN MENU." 2190 CHAIN "K-TMENU",250 2200 ' 2210 ' 2220 ' 2230 ' 2240 ' 2250 ' 3000 ' SUBROUTINE ** KEEP-TRAK Entry Screen (Ch. 8) 3010 ' 3020 PRINT 3030 PRINT " * Edit by pressing entry's number." 3040 PRINT " * Press RETURN after each entry." 3050 PRINT " * If information is not available, press RETURN." 3060 PRINT 3070 PRINT " WARNING: NEVER USE COMMAS OR QUOTATION MARKS." 3080 PRINT " IF NECESSARY, USE DASHES (-)." 3090 PRINT 3100 PRINT "****************************************************" 3110 PRINT FNBIN$; ' Begin Lowered Intensity (Ch. 8) 3120 PRINT "1 - First Name" 3130 PRINT "2 - Last Name" 3140 PRINT "3 - Street Address" 3150 PRINT "4 - City" 3160 PRINT "5 - State" 3170 PRINT "6 - Zip Code" 3180 PRINT "7 - Telephone No." 3190 PRINT "8 - Amount Paid $" 3200 PRINT FNNIN$ ' End Lowered Intensity (Ch. 8) 3210 ' 3220 ' 3230 ' Display Existing Entries 3240 ' 3250 ' 3260 PRINT FNCUR$(11,20);FIRSTNM$ 3270 PRINT FNCUR$(12,20);LASTNM$ 3280 PRINT FNCUR$(13,20);STRTADD$ 3290 PRINT FNCUR$(14,20);CITY$ 3300 PRINT FNCUR$(15,20);STATE$ 3310 PRINT FNCUR$(16,20);ZIP$ 3320 PRINT FNCUR$(17,20);TELNUMBER$ 3330 PRINT FNCUR$(18,20);PAID$ 3340 RETURN 3350 ' 3360 ' 3370 ' 3380 ' 3390 ' 4000 ' SUBROUTINE ** Editing INPUTs 4010 ' 4020 CORRECTIONS$ = "0" ' Set variable to 0 to start 4030 PRINT FNCUR$(11,20);FNCLLN$ ' Clear line (Ch. 8) 4040 PRINT FNCUR$(11,20);:LINE INPUT; FIRSTNM$ 4050 GOSUB 5000:IF ILLEGAL = 1 THEN 4030 ' Check for illegal entry (Ch. 10) 4060 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4070 PRINT FNCUR$(12,20);FNCLLN$ ' Clear line (Ch. 8) 4080 PRINT FNCUR$(12,20);:LINE INPUT; LASTNM$ 4090 GOSUB 6000:IF ILLEGAL = 1 THEN 4070 ' Check for illegal entry (Ch. 10) 4100 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4110 PRINT FNCUR$(13,20);FNCLLN$ ' Clear line (Ch. 8) 4120 PRINT FNCUR$(13,20);:LINE INPUT; STRTADD$ 4130 GOSUB 7000:IF ILLEGAL = 1 THEN 4110 ' Check for illegal entry (Ch. 10) 4140 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4150 PRINT FNCUR$(14,20);FNCLLN$ ' Clear line (Ch. 8) 4160 PRINT FNCUR$(14,20);:LINE INPUT;CITY$ 4170 GOSUB 8000:IF ILLEGAL = 1 THEN 4150 ' Check for illegal entry (Ch. 10) 4180 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4190 PRINT FNCUR$(15,20);FNCLLN$ ' Clear line (Ch. 8) 4200 PRINT FNCUR$(15,20);:LINE INPUT; STATE$ 4210 GOSUB 9000:IF ILLEGAL = 1 THEN 4190 ' Check for illegal entry (Ch. 10) 4220 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4230 PRINT FNCUR$(16,20);FNCLLN$ ' Clear line (Ch. 8) 4240 PRINT FNCUR$(16,20);:LINE INPUT; ZIP$ 4250 GOSUB 10000:IF ILLEGAL = 1 THEN 4230 ' Check for illegal entry (Ch. 10) 4260 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4270 PRINT FNCUR$(17,20);FNCLLN$ ' Clear line (Ch. 8) 4280 PRINT FNCUR$(17,20);:LINE INPUT; TELNUMBER$ 4290 GOSUB 11000:IF ILLEGAL = 1 THEN 4270 ' Check for illegal entry (Ch. 10) 4300 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4310 PRINT FNCUR$(18,20);FNCLLN$ ' Clear line (Ch. 8) 4320 PRINT FNCUR$(18,20);:LINE INPUT; PAID$ 4330 GOSUB 12000:IF ILLEGAL = 1 THEN 4310 ' Check for illegal entry (Ch. 10) 4340 IF VAL(CORRECTIONS$) > 0 THEN 4490 ' If correction, ignore other INPUTs 4350 ' 4360 ' Opportunity for correcting erroneous entries 4370 ' 4380 PRINT FNCUR$(20,3);"1-8 = Edit 9 = Save entry & continue" 4390 PRINT FNCUR$(21,13);"D = Delete whole entry" 4400 PRINT FNCUR$(22,10);"Please choose by number or D." 4410 CORRECTIONS$ = INKEY$:IF CORRECTIONS$ = "" THEN 4410 4420 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN RETURN 4430 ON VAL(CORRECTIONS$) GOTO 4030,4070,4110,4150,4190,4230,4270,4310,4560 4440 ' 4450 ' 4460 ' Catch illegal choices 4470 ' 4480 PRINT CHR$(7); ' Beeper (Ch. 9) 4490 FOR COUNT = 1 TO 3 ' Blink "Please choose" (Ch. 8) 4500 PRINT FNCUR$(22,10);FNCLLN$ ' Clear line (line indentation Ch. 11) 4510 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 4520 PRINT FNCUR$(22,10);"Please choose by number or D." 4530 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 4540 NEXT COUNT 4550 GOTO 4410 ' Try for correct choice 4560 RETURN ' If VAL(CORRECTIONS$) = 9 this line 4570 ' 4580 ' 4590 ' 4600 ' 4610 ' 5000 ' SUBROUTINE ** Prevent illegal FIRSTNM$ entries (Ch. 10) 5010 ' 5020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 5030 IF FIRSTNM$ = "" THEN FIRSTNM$ = "N/A":GOTO 5220 5040 FOR CHECK = 1 TO LEN(FIRSTNM$) ' Legal entries on next line 5050 IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 65 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 90 THEN 5210 ' A through Z 5060 IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 97 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 122 THEN 5210 ' a through z 5070 IF ASC(MID$(FIRSTNM$,CHECK,1)) = 32 OR ASC(MID$(FIRSTNM$,CHECK,1)) = 38 OR ASC(MID$(FIRSTNM$,CHECK,1)) = 39 THEN 5210 ' Space, apostrophe, & ampersand 5080 IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 45 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 46 THEN 5210 ' Dash & period 5090 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 5100 PRINT CHR$(7) ' Beep (Ch. 10) 5110 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 5120 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 5130 FOR COUNT = 1 TO 3 ' Blink error message 5140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 5150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 5160 PRINT FNCUR$(4,20);"Illegal Entry!" 5170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 5180 NEXT COUNT 5190 PRINT FNCUR$(5,8);"Please re-enter without punctuation." 5200 RETURN ' Go back to correct illegal entry 5210 NEXT CHECK 5220 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 5230 RETURN ' No illegal entries, next INPUT 5240 ' 5250 ' 5260 ' 5270 ' 5280 ' 6000 ' SUBROUTINE ** Prevent illegal LASTNM$ entries (Ch. 10) 6010 ' 6020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 6030 IF LASTNM$ = "" THEN LASTNM$ = "N/A":GOTO 6220 6040 FOR CHECK = 1 TO LEN(LASTNM$) ' Legal entries on next line 6050 IF ASC(MID$(LASTNM$,CHECK,1)) >= 65 AND ASC(MID$(LASTNM$,CHECK,1)) <= 90 THEN 6210 ' A through Z 6060 IF ASC(MID$(LASTNM$,CHECK,1)) >= 97 AND ASC(MID$(LASTNM$,CHECK,1)) <= 122 THEN 6210 ' a through z 6070 IF ASC(MID$(LASTNM$,CHECK,1)) = 32 OR ASC(MID$(LASTNM$,CHECK,1)) = 38 OR ASC(MID$(LASTNM$,CHECK,1)) = 39 THEN 6210 ' Space, apostrophe, & ampersand 6080 IF ASC(MID$(LASTNM$,CHECK,1)) >= 45 AND ASC(MID$(LASTNM$,CHECK,1)) <= 46 THEN 6210 ' Dash & period 6090 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 6100 PRINT CHR$(7) ' Beep (Ch. 10) 6110 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 6120 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 6130 FOR COUNT = 1 TO 3 ' Blink error message 6140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 6150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 6160 PRINT FNCUR$(4,20);"Illegal Entry!" 6170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 6180 NEXT COUNT 6190 PRINT FNCUR$(5,8);"Please re-enter without punctuation." 6200 RETURN ' Go back to correct illegal entry 6210 NEXT CHECK 6220 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 6230 RETURN ' No illegal entries, next INPUT 6240 ' 6250 ' 6260 ' 6270 ' 6280 ' 7000 ' SUBROUTINE ** Prevent illegal STRTADD$ entries (Ch. 10) 7010 ' 7020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 7030 IF STRTADD$ = "" THEN STRTADD$ = "N/A":GOTO 7200 7040 FOR CHECK = 1 TO LEN(STRTADD$) ' Legal entries on next line 7050 IF ASC(MID$(STRTADD$,CHECK,1)) >= 45 AND ASC(MID$(STRTADD$,CHECK,1)) <= 122 THEN 7190 ' All numbers, letters, period, & dash 7060 IF ASC(MID$(STRTADD$,CHECK,1)) = 32 OR ASC(MID$(STRTADD$,CHECK,1)) = 35 OR ASC(MID$(STRTADD$,CHECK,1)) = 39 THEN 7190 ' Space, hash mark, & apostrophe 7070 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 7080 PRINT CHR$(7) ' Beep (Ch. 10) 7090 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 7100 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 7110 FOR COUNT = 1 TO 3 ' Blink error message 7120 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 7130 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 7140 PRINT FNCUR$(4,20);"Illegal Entry!" 7150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 7160 NEXT COUNT 7170 PRINT FNCUR$(5,8);"Please re-enter without punctuation." 7180 RETURN ' Go back to correct illegal entry 7190 NEXT CHECK 7200 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 7210 RETURN ' No illegal entries, next INPUT 7220 ' 7230 ' 7240 ' 7250 ' 7260 ' 8000 ' SUBROUTINE ** Prevent illegal CITY$ entries (Ch. 10) 8010 ' 8020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 8030 IF CITY$ = "" THEN CITY$ = "N/A":GOTO 8220 8040 FOR CHECK = 1 TO LEN(CITY$) ' Legal entries on next line 8050 IF ASC(MID$(CITY$,CHECK,1)) >= 65 AND ASC(MID$(CITY$,CHECK,1)) <= 90 THEN 8210 ' A through Z 8060 IF ASC(MID$(CITY$,CHECK,1)) >= 97 AND ASC(MID$(CITY$,CHECK,1)) <= 122 THEN 8210 ' a through z 8070 IF ASC(MID$(CITY$,CHECK,1)) = 32 OR ASC(MID$(CITY$,CHECK,1)) = 38 OR ASC(MID$(CITY$,CHECK,1)) = 39 THEN 8210 ' Space, apostrophe, & ampersand 8080 IF ASC(MID$(CITY$,CHECK,1)) >= 45 AND ASC(MID$(CITY$,CHECK,1)) <= 46 THEN 8210 ' Dash & period 8090 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 8100 PRINT CHR$(7) ' Beep (Ch. 10) 8110 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 8120 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 8130 FOR COUNT = 1 TO 3 ' Blink error message 8140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 8150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 8160 PRINT FNCUR$(4,20);"Illegal Entry!" 8170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 8180 NEXT COUNT 8190 PRINT FNCUR$(5,8);"Please re-enter without punctuation." 8200 RETURN ' Go back to correct illegal entry 8210 NEXT CHECK 8220 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 8230 RETURN ' No illegal entries, next INPUT 8240 ' 8250 ' 8260 ' 8270 ' 9000 ' SUBROUTINE ** Prevent illegal STATE$ entries (Ch. 10) 9010 ' 9020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 9030 IF STATE$ = "" THEN STATE$ = "N/A":GOTO 9220 9040 FOR CHECK = 1 TO LEN(STATE$) ' Legal entries on next line 9050 IF ASC(MID$(STATE$,CHECK,1)) >= 65 AND ASC(MID$(STATE$,CHECK,1)) <= 90 THEN 9210 ' A through Z 9060 IF ASC(MID$(STATE$,CHECK,1)) >= 97 AND ASC(MID$(STATE$,CHECK,1)) <= 122 THEN 9210 ' a through z 9070 IF ASC(MID$(STATE$,CHECK,1)) = 32 OR ASC(MID$(STATE$,CHECK,1)) = 38 OR ASC(MID$(STATE$,CHECK,1)) = 39 THEN 9210 ' Space, apostrophe, & ampersand 9080 IF ASC(MID$(STATE$,CHECK,1)) >= 45 AND ASC(MID$(STATE$,CHECK,1)) <= 46 THEN 9210 ' Dash & period 9090 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 9100 PRINT CHR$(7) ' Beep (Ch. 10) 9110 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 9120 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 9130 FOR COUNT = 1 TO 3 ' Blink error message 9140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 9150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 9160 PRINT FNCUR$(4,20);"Illegal Entry!" 9170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 9180 NEXT COUNT 9190 PRINT FNCUR$(5,8);"Please re-enter without punctuation." 9200 RETURN ' Go back to correct illegal entry 9210 NEXT CHECK 9220 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 9230 RETURN ' No illegal entries, next INPUT 9240 ' 9250 ' 9260 ' 9270 ' 9280 ' 10000 ' SUBROUTINE ** Prevent illegal ZIP$ entries (Ch. 10) 10010 ' 10020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 10030 IF ZIP$ = "" THEN ZIP$ = "N/A":GOTO 10190 10040 FOR CHECK = 1 TO LEN(ZIP$) ' Legal entries on next line 10050 IF ASC(MID$(ZIP$,CHECK,1)) >= 48 AND ASC(MID$(ZIP$,CHECK,1)) <= 57 OR ASC(MID$(ZIP$,CHECK,1)) = 45 THEN 10180 ' Digits & dash 10060 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 10070 PRINT CHR$(7) ' Beep (Ch. 10) 10080 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 10090 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 10100 FOR COUNT = 1 TO 3 ' Blink error message 10110 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 10120 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 10130 PRINT FNCUR$(4,20);"Illegal Entry!" 10140 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 10150 NEXT COUNT 10160 PRINT FNCUR$(5,9);"Please re-enter: five digits only." 10170 RETURN ' Go back to correct illegal entry 10180 NEXT CHECK 10190 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 10200 RETURN ' No illegal entries, next INPUT 10210 ' 10220 ' 10230 ' 10240 ' 10250 ' 11000 ' SUBROUTINE ** Prevent illegal TELNUMBER$ entries (Ch. 10) 11010 ' 11020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 11030 IF TELNUMBER$ = "" THEN TELNUMBER$ = "N/A":GOTO 11190 11040 FOR CHECK = 1 TO LEN(TELNUMBER$) ' Legal entries on next line 11050 IF ASC(MID$(TELNUMBER$,CHECK,1)) >= 48 AND ASC(MID$(TELNUMBER$,CHECK,1)) <= 57 OR ASC(MID$(TELNUMBER$,CHECK,1)) = 45 THEN 11180 ' Digits & dash 11060 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 11070 PRINT CHR$(7) ' Beep (Ch. 10) 11080 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 11090 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 11100 FOR COUNT = 1 TO 3 ' Blink error message 11110 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 11120 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 11130 PRINT FNCUR$(4,20);"Illegal Entry!" 11140 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 11150 NEXT COUNT 11160 PRINT FNCUR$(5,6);"Please re-enter in the form XXX-XXX-XXXX." 11170 RETURN ' Go back to correct illegal entry 11180 NEXT CHECK 11190 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 11200 RETURN ' No illegal entries, next INPUT 11210 ' 11220 ' 11230 ' 11240 ' 11250 ' 12000 ' SUBROUTINE ** Prevent illegal PAID$ entries (Ch. 10) 12010 ' 12020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 12030 IF PAID$ = "" THEN PAID$ = "0":GOTO 12190 12040 FOR CHECK = 1 TO LEN(PAID$) ' Legal entries on next line 12050 IF ASC(MID$(PAID$,CHECK,1)) >= 48 AND ASC(MID$(PAID$,CHECK,1)) <= 57 OR ASC(MID$(PAID$,CHECK,1)) = 46 THEN 12180 ' Digits & period (decimal pt.) 12060 ILLEGAL = 1 ' Illegal entry found (Ch. 10) 12070 PRINT CHR$(7) ' Beep (Ch. 10) 12080 PRINT FNCUR$(3,0);FNCLLN$ ' Clear third line from top 12090 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 12100 FOR COUNT = 1 TO 3 ' Blink error message 12110 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 12120 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 12130 PRINT FNCUR$(4,20);"Illegal Entry!" 12140 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 12150 NEXT COUNT 12160 PRINT FNCUR$(5,2);"Please re-enter: Digits (& decimal pt) only." 12170 RETURN ' Go back to correct illegal entry 12180 NEXT CHECK 12190 GOSUB 13000 ' Replace INPUT instructions once illegal INPUT's corrected 12200 RETURN ' No illegal entries, next INPUT 12210 ' 12220 ' 12230 ' 12240 ' 12250 ' 13000 ' SUBROUTINE ** Replace INPUT instructions after illegal INPUT's corrected 13010 ' 13020 PRINT FNCUR$(3,0);" * Edit by pressing entry's number." 13030 PRINT " * Press RETURN after each entry." 13040 PRINT " * If information is not available, press RETURN." 13050 RETURN 13060 ' 13070 ' 13080 ' 13090 ' 13100 ' 14000 ' SUBROUTINE ** Explanation of why no entry might have been found 14010 ' 14020 PRINT TAB(10);"** End of Membership List **" 14030 PRINT:PRINT 14040 PRINT " The entry you want isn't in the file the way" 14050 PRINT " you entered it. Did you enter it (including" 14060 PRINT " capitalization and punctuation) the way it" 14070 PRINT " originally appeared in the list?" 14080 RETURN 14090 ' 14100 ' 14110 ' 14120 ' 14130 ' 15000 ' SUBROUTINE ** Prevent illegal FIRSTNAME$ entries (Ch. 10) 15010 ' 15020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 15030 IF FIRSTNAME$ = "" THEN FIRSTNAME$ = "N/A":GOTO 15220 15040 FOR CHECK = 1 TO LEN(FIRSTNAME$) ' Legal entries on next line 15050 IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 65 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 90 THEN 15210 ' A through Z 15060 IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 97 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 122 THEN 15210 ' a through z 15070 IF ASC(MID$(FIRSTNAME$,CHECK,1)) = 32 OR ASC(MID$(FIRSTNAME$,CHECK,1)) = 38 OR ASC(MID$(FIRSTNAME$,CHECK,1)) = 39 THEN 15210 ' Space apostrophe, & ampersand 15080 IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 45 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 46 THEN 15210 ' Dash & period 15090 ILLEGAL = 1 ' ILlegal entry found (Ch. 10) 15100 PRINT CHR$(7) ' Beep (Ch. 10) 15110 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 15120 PRINT FNCUR$(6,0);FNCLLN$ ' Clear sixth line from top 15130 FOR COUNT = 1 TO 3 ' Bink error message 15140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 15150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 15160 PRINT FNCUR$(4,18);"Illegal Entry!" 15170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 15180 NEXT COUNT 15190 PRINT FNCUR$(5,2);"Please re-enter without digits or punctuation." 15200 RETURN ' Go back to correct entry 15210 NEXT CHECK 15220 GOSUB 17000 ' Replace INPUT instructions once illegal INPUT's corrected 15230 RETURN ' No illegal entries, next INPUT 15240 ' 15250 ' 15260 ' 15270 ' 15280 ' 16000 ' SUBROUTINE ** Prevent illegal LASTNAME$ entries (Ch. 10) 16010 ' 16020 ILLEGAL = 0 ' No illegal entry yet, just checking (Ch. 10) 16030 IF LASTNAME$ = "" THEN LASTNAME$ = "N/A":GOTO 15220 16040 FOR CHECK = 1 TO LEN(LASTNAME$) ' Legal entries on next line 16050 IF ASC(MID$(LASTNAME$,CHECK,1)) >= 65 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 90 THEN 16210 ' A through Z 16060 IF ASC(MID$(LASTNAME$,CHECK,1)) >= 97 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 122 THEN 16210 ' a through z 16070 IF ASC(MID$(LASTNAME$,CHECK,1)) = 32 OR ASC(MID$(LASTNAME$,CHECK,1)) = 38 OR ASC(MID$(LASTNAME$,CHECK,1)) = 39 THEN 16210 ' Space apostrophe, & ampersand 16080 IF ASC(MID$(LASTNAME$,CHECK,1)) >= 45 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 46 THEN 16210 ' Dash & period 16090 ILLEGAL = 1 ' ILlegal entry found (Ch. 10) 16100 PRINT CHR$(7) ' Beep (Ch. 10) 16110 PRINT FNCUR$(5,0);FNCLLN$ ' Clear fifth line from top 16120 PRINT FNCUR$(6,0);FNCLLN$ ' Clear sixth line from top 16130 FOR COUNT = 1 TO 3 ' Bink error message 16140 PRINT FNCUR$(4,0);FNCLLN$ ' Clear fourth line from top 16150 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 16160 PRINT FNCUR$(4,18);"Illegal Entry!" 16170 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Count to 100 silently (Ch. 7) 16180 NEXT COUNT 16190 PRINT FNCUR$(5,2);"Please re-enter without digits or punctuation." 16200 RETURN ' Go back to correct entry 16210 NEXT CHECK 16220 GOSUB 17000 ' Replace INPUT instructions once illegal INPUT's corrected 16230 RETURN ' No illegal entries 16240 ' 16250 ' 16260 ' 16270 ' 16280 ' 17000 ' SUBROUTINE ** Replace INPUT instructions after illegal INPUT's corrected 17010 ' 17020 PRINT FNCUR$(4,0);" Enter the first and last names of the person" 17030 PRINT " whose address and telephone number you want to" 17040 PRINT FNCLLN$;" edit." 17050 RETURN 17060 ' 17070 ' 17080 ' 17090 ' 17100 ' 20000 ' ** Error Traps ** (Ch. 10) 20010 ' 20020 IF ERR <> 53 AND ERL <> 300 THEN 20210 ' Trap File not Found in line 300 20030 PRINT CHR$(7) ' Beep (Ch. 10) 20040 PRINT CL$ ' Clear screen (Ch. 7) 20050 PRINT 20060 PRINT TAB(17);"*** Error ***" 20070 PRINT:PRINT:PRINT:PRINT ' 4 blank lines 20080 PRINT "There is no membership list on the diskette in B:." 20090 PRINT:PRINT:PRINT:PRINT ' 4 blank lines 20100 PRINT TAB(4);"You can't edit a list that doesn't exist." 20110 PRINT:PRINT:PRINT:PRINT ' 4 blank lines 20120 PRINT "Please press any key to return to the MAIN MENU." 20130 IF INKEY$ = "" THEN 20130 ' Wait for keypress (Ch. 7) 20140 PRINT:PRINT:PRINT:RESUME 2180 ' Return to MAIN MENU 20150 ' 20160 ' 20170 ' 20180 ' 20190 ' 20200 ' 20210 ' Catch-all Error Trap (Ch. 10) 20220 ' 20230 PRINT CHR$(7) ' Beep (Ch. 10) 20240 PRINT CL$ ' Clear screen (Ch. 7) 20250 PRINT:PRINT ' 2 blank lines 20260 PRINT "You have generated error number";ERR 20270 PRINT "on line number";ERL;"." 20280 PRINT 20290 PRINT "Please write this fact down. Also write down ex-" 20300 PRINT "actly what you did before this error took place." 20310 PRINT 20320 PRINT "Ask a BASIC programmer what the error means and" 20330 PRINT "how to correct it." 20340 PRINT:PRINT ' 2 blank lines 20350 PRINT "Press any key to return to the MAIN MENU." 20360 IF INKEY$ = "" THEN 20360 ' Waiting for keypress (Ch. 7) 20370 PRINT:PRINT:RESUME 2180 ' Return to MAIN MENU