home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / KEEPTRAK.LBR / K-TEDIT.BZS / K-TEDIT.BAS
BASIC Source File  |  2000-06-30  |  30KB  |  635 lines

  1. 10  ' **********************************************
  2. 20  ' **********************************************
  3. 30  ' ***               K-TEDIT                  ***
  4. 40  ' ***      PART OF A CLUB MEMBERSHIP     ***
  5. 50  ' ***    FILING SYSTEM CALLED KEEP-TRAK     ***
  6. 60  ' ***                     ***
  7. 70  ' ***                                        ***
  8. 80  ' *** WRITTEN IN MICROSOFT BASIC-80 REV.5.21 ***
  9. 90  ' ***                                        ***
  10. 100 ' ***  (C) COPYRIGHT 1983 BY HARVEY G. LORD  ***
  11. 110 ' ***                                        ***
  12. 120 ' ***   DO NOT ATTEMPT TO RUN THIS PROGRAM   ***
  13. 130 ' ***   ALONE. IT IS CHAINED FROM K-TMENU.   ***
  14. 140 ' **********************************************
  15. 150 ' **********************************************
  16. 160 '
  17. 170 ON ERROR GOTO 20000                ' Error traps (Ch. 10)
  18. 180 COMMON CL$,RECORDTOTAL            ' Pass variables to programs (Ch. 11)
  19. 190 ' Define cursor control (Ch. 8)
  20. 200 DEF FNCUR$(VERT,HORZ) = CHR$(27)+CHR$(61)+CHR$(32+VERT)+CHR$(32+HORZ)
  21. 210 DEF FNBIN$ = CHR$(27)+CHR$(41)         ' Define begin lowered intensity (Ch. 8)
  22. 220 DEF FNNIN$ = CHR$(27)+CHR$(40)         ' Define end lowered intensity   (Ch. 8)
  23. 230 DEF FNCLLN$ = CHR$(27) + CHR$(84)         ' Define clear line from cursor (Ch. 8)
  24. 240 '
  25. 250 '
  26. 260 '
  27. 270 '
  28. 280 '
  29. 290 ' Check for B:K-T.LST's existence.  If it's not there, to error trap
  30. 300 OPEN "I",#1,"B:K-T.LST":CLOSE#1
  31. 310 '
  32. 320 ' The rest of the program's executed only if B:K-T.LST exists.
  33. 330 '
  34. 340 ' Menu: Edit all members or only certain ones.
  35. 350 '
  36. 360 PRINT CL$                    ' Clear screen (Ch. 7)
  37. 370 PRINT:PRINT                    ' 2 blank lines
  38. 380 PRINT TAB(9);"**  Change Club Member's Entries  **"
  39. 390 PRINT:PRINT                    ' 2 blank lines
  40. 400 PRINT "You may look at every entry in the membership list,"
  41. 410 PRINT "editing as you go"
  42. 420 PRINT
  43. 430 PRINT TAB(24);"OR"
  44. 440 PRINT
  45. 450 PRINT "you may let the computer search through the member-"
  46. 460 PRINT "ship list for the one (or more) entries you wish to"
  47. 470 PRINT "change."
  48. 480 PRINT:PRINT                    ' 2 blank lines
  49. 490 PRINT TAB(7);"S - Search for member's entry to edit"
  50. 500 PRINT TAB(7);"G - Global editing of all entries"
  51. 510 PRINT TAB(7);"R - Return to MAIN MENU"
  52. 520 PRINT:PRINT                    ' 2 blank lines
  53. 530 PRINT TAB(14);"Please choose by letter."
  54. 540 CHOICE$ = INKEY$:IF CHOICE$ = "" THEN 540
  55. 550 IF CHOICE$ = "S" OR CHOICE$ = "s" THEN 1000
  56. 560 IF CHOICE$ = "G" OR CHOICE$ = "g" THEN 2000
  57. 570 IF CHOICE$ = "R" OR CHOICE$ = "r" THEN PRINT:PRINT:GOTO 2180
  58. 580 '
  59. 590 '
  60. 600 ' Catch illegal choices
  61. 610 '
  62. 620 PRINT CHR$(7);                ' Beep (Ch. 10)
  63. 630 FOR COUNT = 1 TO 3                ' Blink "Please choose" (Ch. 8)
  64. 640    PRINT FNCUR$(21,8);FNCLLN$        ' Clear line (Ch. 8)
  65. 650    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  66. 660    PRINT FNCUR$(21,8);"Please choose 'S,' 'G,' or 'R.'
  67. 670    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  68. 680 NEXT COUNT
  69. 690 GOTO 540
  70. 700 '
  71. 710 '
  72. 720 '
  73. 730 '
  74. 740 '
  75. 1000 ' Search B:K-T.LST for entries to edit (Ch. 6)
  76. 1010 '
  77. 1020 FOUNDIT = 0                ' Found no entry; FOUNDIT = 1 means entry is found
  78. 1030 OPEN "I",#1,"B:K-T.LST"            ' OPEN B:K-T.LST for reading (Ch. 5)
  79. 1040 OPEN "O",#2,"B:COPY"            ' OPEN B:COPY for writing (Ch. 5)
  80. 1050 PRINT CL$                    ' Clear screen (Ch. 7)
  81. 1060 PRINT "  ***  Search for and Edit Specific Entries   ***"
  82. 1070 PRINT:PRINT                ' 2 blank lines
  83. 1080 PRINT "  Enter the  first and last  names of the  person"
  84. 1090 PRINT "  whose address  and telephone number you want to"
  85. 1100 PRINT "  edit."
  86. 1110 PRINT
  87. 1120 PRINT "  NOTE:  Spelling, including upper and lower case"
  88. 1130 PRINT "  letters, COUNTS."
  89. 1140 PRINT
  90. 1150 PRINT "  Misspelling causes computer errors."
  91. 1160 PRINT:PRINT                ' 2 blank lines
  92. 1170 PRINT "  FIRST NAME (then press RETURN):"
  93. 1180 PRINT "  LAST NAME  (then press RETURN):"
  94. 1190 PRINT FNCUR$(14,36);FNCLLN$        ' Clear line (Ch. 8)
  95. 1200 PRINT FNCUR$(14,36);:LINE INPUT;FIRSTNAME$
  96. 1210 GOSUB 15000:IF ILLEGAL = 1 THEN 1190    ' Check for illegal entry (Ch. 10)
  97. 1220 PRINT FNCUR$(15,36);FNCLLN$        ' Clear line (Ch. 8)
  98. 1230 PRINT FNCUR$(15,36);:LINE INPUT;LASTNAME$
  99. 1240 GOSUB 16000:IF ILLEGAL = 1 THEN 1220    ' Check for illegal entry (Ch. 10)
  100. 1250 PRINT FNCUR$(17,2);"Searching.  Please wait."
  101. 1260 IF EOF(1) THEN CLOSE#1:GOTO 1370        ' Check for end-of-file (Ch. 3)
  102. 1270 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$
  103. 1280 IF FIRSTNM$ <> FIRSTNAME$ OR LASTNM$ <> LASTNAME$ THEN 1350
  104. 1290 FOUNDIT = 1                ' Found the entry
  105. 1300 PRINT CL$                    ' Clear screen (Ch. 7)
  106. 1310 PRINT "    ***   Here's the entry you asked for   ***"
  107. 1320 GOSUB 3000                    ' Display record
  108. 1330 GOSUB 4360                    ' Edit record
  109. 1340 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN 1260 ' Delete record (Ch. 5)
  110. 1350 PRINT#2,FIRSTNM$;",";LASTNM$;",";STRTADD$;",";CITY$;",";STATE$;",";ZIP$;",";TELNUMBER$;",";PAID$
  111. 1360 GOTO 1260                    ' Loop back for more records
  112. 1370 KILL "B:K-T.LST"                ' Erase B:K-T.LST
  113. 1380 CLOSE#2                    ' CLOSE B:COPY
  114. 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.
  115. 1400 '
  116. 1410 '
  117. 1420 '
  118. 1430 '
  119. 1440 '
  120. 1450 ' Give opportunity to search for and edit more records
  121. 1460 '
  122. 1470 PRINT CL$                    ' Clear screen (Ch. 7)
  123. 1480 IF FOUNDIT = 0 THEN GOSUB 14000:GOTO 1540  ' Found no entry explanation
  124. 1490 PRINT:PRINT                ' 2 blank lines
  125. 1500 PRINT TAB(11);"**  End of Membership List  **
  126. 1510 PRINT:PRINT                ' 2 blank lines
  127. 1520 PRINT "  You may now search for and edit another entry or"
  128. 1530 PRINT TAB(14);"return to the MAIN MENU."
  129. 1540 PRINT:PRINT:PRINT                ' 3 blank lines
  130. 1550 PRINT TAB(7);"S - Search for another entry to edit"
  131. 1560 PRINT TAB(7);"R - Return to MAIN MENU"
  132. 1570 PRINT:PRINT:PRINT                ' 3 blank lines
  133. 1580 PRINT TAB(14);"Please choose by letter."
  134. 1590 CHOICE$ = INKEY$:IF CHOICE$ = "" THEN 1590
  135. 1600 IF CHOICE$ = "S" OR CHOICE$ = "s" THEN 1000
  136. 1610 IF CHOICE$ = "R" OR CHOICE$ = "r" THEN PRINT:PRINT:GOTO 2180
  137. 1620 '
  138. 1630 ' Catch illegal choices
  139. 1640 '
  140. 1650 PRINT CHR$(7);                ' Beep (Ch. 10)
  141. 1660 FOR COUNT = 1 TO 3                ' Blink "Please choose" (Ch. 8)
  142. 1670    PRINT FNCUR$(16,13);FNCLLN$        ' Clear line (Ch. 8)
  143. 1680    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  144. 1690    PRINT FNCUR$(16,13);"Please choose 'S' or 'R.'"
  145. 1700    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  146. 1710 NEXT COUNT
  147. 1720 GOTO 1590
  148. 1730 '
  149. 1740 '
  150. 1750 '
  151. 1760 '
  152. 1770 '
  153. 2000 ' Global Edit - All Records (Ch. 5)
  154. 2010 '
  155. 2020 OPEN "I",#1,"B:K-T.LST"            ' OPEN B:K-T.LST for reading (Ch. 5)
  156. 2030 OPEN "O",#2,"B:COPY"            ' OPEN B:COPY for writing (Ch. 5)
  157. 2040 PRINT CL$                    ' Clear screen (Ch. 7)
  158. 2050 IF EOF(1) THEN CLOSE#1:GOTO 2130        ' Check for end-of-file (Ch. 3)
  159. 2060 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$
  160. 2070 PRINT TAB(16);"**  Edit All Members  **"
  161. 2080 GOSUB 3000                    ' Display & edit record
  162. 2090 GOSUB 4360                    ' Edit
  163. 2100 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN 2040 ' Delete record
  164. 2110 PRINT#2,FIRSTNM$;",";LASTNM$;",";STRTADD$;",";CITY$;",";STATE$;",";ZIP$;",";TELNUMBER$;",";PAID$
  165. 2120 GOTO 2040                    ' Loop back for next record
  166. 2130 KILL "B:K-T.LST"                ' Erase B:K-T.LST
  167. 2140 CLOSE #2
  168. 2150 NAME "B:COPY" AS "B:K-T.LST"
  169. 2160 PRINT:PRINT                ' 2 blank lines
  170. 2170 PRINT TAB(14);"That's the whole  file."
  171. 2180 PRINT TAB(14);"Returning to MAIN MENU."
  172. 2190 CHAIN "K-TMENU",250
  173. 2200 '
  174. 2210 '
  175. 2220 '
  176. 2230 '
  177. 2240 '
  178. 2250 '
  179. 3000 ' SUBROUTINE ** KEEP-TRAK Entry Screen  (Ch. 8)
  180. 3010 '
  181. 3020 PRINT
  182. 3030 PRINT "   * Edit by pressing entry's number."
  183. 3040 PRINT "   * Press  RETURN after each entry."
  184. 3050 PRINT "   * If information is not available, press RETURN."
  185. 3060 PRINT
  186. 3070 PRINT "   WARNING:  NEVER USE COMMAS OR QUOTATION MARKS."
  187. 3080 PRINT "           IF NECESSARY, USE DASHES (-)."
  188. 3090 PRINT
  189. 3100 PRINT "****************************************************"
  190. 3110 PRINT FNBIN$;                ' Begin Lowered Intensity (Ch. 8)
  191. 3120 PRINT "1 - First Name"
  192. 3130 PRINT "2 - Last Name"
  193. 3140 PRINT "3 - Street Address"
  194. 3150 PRINT "4 - City"
  195. 3160 PRINT "5 - State"
  196. 3170 PRINT "6 - Zip Code"
  197. 3180 PRINT "7 - Telephone No."
  198. 3190 PRINT "8 - Amount Paid    $"
  199. 3200 PRINT FNNIN$                ' End Lowered Intensity (Ch. 8)
  200. 3210 '
  201. 3220 '
  202. 3230 ' Display Existing Entries
  203. 3240 '
  204. 3250 '
  205. 3260 PRINT FNCUR$(11,20);FIRSTNM$
  206. 3270 PRINT FNCUR$(12,20);LASTNM$
  207. 3280 PRINT FNCUR$(13,20);STRTADD$
  208. 3290 PRINT FNCUR$(14,20);CITY$
  209. 3300 PRINT FNCUR$(15,20);STATE$
  210. 3310 PRINT FNCUR$(16,20);ZIP$
  211. 3320 PRINT FNCUR$(17,20);TELNUMBER$
  212. 3330 PRINT FNCUR$(18,20);PAID$
  213. 3340 RETURN
  214. 3350 '
  215. 3360 '
  216. 3370 '
  217. 3380 '
  218. 3390 '
  219. 4000 ' SUBROUTINE **  Editing INPUTs
  220. 4010 '
  221. 4020 CORRECTIONS$ = "0"                ' Set variable to 0 to start
  222. 4030 PRINT FNCUR$(11,20);FNCLLN$        ' Clear line (Ch. 8)
  223. 4040 PRINT FNCUR$(11,20);:LINE INPUT; FIRSTNM$
  224. 4050 GOSUB 5000:IF ILLEGAL = 1 THEN 4030     ' Check for illegal entry (Ch. 10)
  225. 4060 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  226. 4070 PRINT FNCUR$(12,20);FNCLLN$        ' Clear line (Ch. 8)
  227. 4080 PRINT FNCUR$(12,20);:LINE INPUT; LASTNM$
  228. 4090 GOSUB 6000:IF ILLEGAL = 1 THEN 4070     ' Check for illegal entry (Ch. 10)
  229. 4100 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  230. 4110 PRINT FNCUR$(13,20);FNCLLN$        ' Clear line (Ch. 8)
  231. 4120 PRINT FNCUR$(13,20);:LINE INPUT; STRTADD$
  232. 4130 GOSUB 7000:IF ILLEGAL = 1 THEN 4110     ' Check for illegal entry (Ch. 10)
  233. 4140 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  234. 4150 PRINT FNCUR$(14,20);FNCLLN$        ' Clear line (Ch. 8)
  235. 4160 PRINT FNCUR$(14,20);:LINE INPUT;CITY$
  236. 4170 GOSUB 8000:IF ILLEGAL = 1 THEN 4150     ' Check for illegal entry (Ch. 10)
  237. 4180 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  238. 4190 PRINT FNCUR$(15,20);FNCLLN$        ' Clear line (Ch. 8)
  239. 4200 PRINT FNCUR$(15,20);:LINE INPUT; STATE$
  240. 4210 GOSUB 9000:IF ILLEGAL = 1 THEN 4190     ' Check for illegal entry (Ch. 10)
  241. 4220 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  242. 4230 PRINT FNCUR$(16,20);FNCLLN$        ' Clear line (Ch. 8)
  243. 4240 PRINT FNCUR$(16,20);:LINE INPUT; ZIP$
  244. 4250 GOSUB 10000:IF ILLEGAL = 1 THEN 4230     ' Check for illegal entry (Ch. 10)
  245. 4260 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  246. 4270 PRINT FNCUR$(17,20);FNCLLN$        ' Clear line (Ch. 8)
  247. 4280 PRINT FNCUR$(17,20);:LINE INPUT; TELNUMBER$
  248. 4290 GOSUB 11000:IF ILLEGAL = 1 THEN 4270     ' Check for illegal entry (Ch. 10)
  249. 4300 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  250. 4310 PRINT FNCUR$(18,20);FNCLLN$        ' Clear line (Ch. 8)
  251. 4320 PRINT FNCUR$(18,20);:LINE INPUT; PAID$
  252. 4330 GOSUB 12000:IF ILLEGAL = 1 THEN 4310     ' Check for illegal entry (Ch. 10)
  253. 4340 IF VAL(CORRECTIONS$) > 0 THEN 4490        ' If correction, ignore other INPUTs
  254. 4350 '
  255. 4360 ' Opportunity for correcting erroneous entries
  256. 4370 '
  257. 4380 PRINT FNCUR$(20,3);"1-8 = Edit        9 = Save entry & continue"
  258. 4390 PRINT FNCUR$(21,13);"D = Delete whole entry"
  259. 4400 PRINT FNCUR$(22,10);"Please choose by number or D."
  260. 4410 CORRECTIONS$ = INKEY$:IF CORRECTIONS$ = "" THEN 4410
  261. 4420 IF CORRECTIONS$ = "D" OR CORRECTIONS$ = "d" THEN RETURN
  262. 4430 ON VAL(CORRECTIONS$) GOTO 4030,4070,4110,4150,4190,4230,4270,4310,4560
  263. 4440 '
  264. 4450 '
  265. 4460 ' Catch illegal choices
  266. 4470 '
  267. 4480 PRINT CHR$(7);                ' Beeper (Ch. 9)
  268. 4490 FOR COUNT = 1 TO 3                ' Blink "Please choose" (Ch. 8)
  269. 4500    PRINT FNCUR$(22,10);FNCLLN$        ' Clear line (line indentation Ch. 11)
  270. 4510    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  271. 4520    PRINT FNCUR$(22,10);"Please choose by number or D."
  272. 4530    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Count to 100 silently (Ch. 7)
  273. 4540 NEXT COUNT
  274. 4550 GOTO 4410                    ' Try for correct choice
  275. 4560 RETURN                    ' If VAL(CORRECTIONS$) = 9 this line
  276. 4570 '
  277. 4580 '
  278. 4590 '
  279. 4600 '
  280. 4610 '
  281. 5000 ' SUBROUTINE ** Prevent illegal FIRSTNM$ entries (Ch. 10)
  282. 5010 '
  283. 5020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  284. 5030 IF FIRSTNM$ = "" THEN FIRSTNM$ = "N/A":GOTO 5220
  285. 5040 FOR CHECK = 1 TO LEN(FIRSTNM$)        ' Legal entries on next line
  286. 5050    IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 65 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 90 THEN 5210 ' A through Z
  287. 5060    IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 97 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 122 THEN 5210 ' a through z
  288. 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
  289. 5080    IF ASC(MID$(FIRSTNM$,CHECK,1)) >= 45 AND ASC(MID$(FIRSTNM$,CHECK,1)) <= 46 THEN 5210 ' Dash & period
  290. 5090    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  291. 5100    PRINT CHR$(7)                ' Beep (Ch. 10)
  292. 5110    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  293. 5120    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  294. 5130    FOR COUNT = 1 TO 3            ' Blink error message
  295. 5140       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  296. 5150       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  297. 5160       PRINT FNCUR$(4,20);"Illegal Entry!"
  298. 5170       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  299. 5180    NEXT COUNT
  300. 5190    PRINT FNCUR$(5,8);"Please re-enter without punctuation."
  301. 5200    RETURN                    ' Go back to correct illegal entry
  302. 5210 NEXT CHECK
  303. 5220 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  304. 5230 RETURN                    ' No illegal entries, next INPUT
  305. 5240 '
  306. 5250 '
  307. 5260 '
  308. 5270 '
  309. 5280 '
  310. 6000 ' SUBROUTINE ** Prevent illegal LASTNM$ entries (Ch. 10)
  311. 6010 '
  312. 6020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  313. 6030 IF LASTNM$ = "" THEN LASTNM$ = "N/A":GOTO 6220
  314. 6040 FOR CHECK = 1 TO LEN(LASTNM$)        ' Legal entries on next line
  315. 6050    IF ASC(MID$(LASTNM$,CHECK,1)) >= 65 AND ASC(MID$(LASTNM$,CHECK,1)) <= 90 THEN 6210 ' A through Z
  316. 6060    IF ASC(MID$(LASTNM$,CHECK,1)) >= 97 AND ASC(MID$(LASTNM$,CHECK,1)) <= 122 THEN 6210 ' a through z
  317. 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
  318. 6080    IF ASC(MID$(LASTNM$,CHECK,1)) >= 45 AND ASC(MID$(LASTNM$,CHECK,1)) <= 46 THEN 6210 ' Dash & period
  319. 6090    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  320. 6100    PRINT CHR$(7)                ' Beep (Ch. 10)
  321. 6110    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  322. 6120    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  323. 6130    FOR COUNT = 1 TO 3            ' Blink error message
  324. 6140       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  325. 6150       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  326. 6160       PRINT FNCUR$(4,20);"Illegal Entry!"
  327. 6170       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  328. 6180    NEXT COUNT
  329. 6190    PRINT FNCUR$(5,8);"Please re-enter without punctuation."
  330. 6200    RETURN                    ' Go back to correct illegal entry
  331. 6210 NEXT CHECK
  332. 6220 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  333. 6230 RETURN                    ' No illegal entries, next INPUT
  334. 6240 '
  335. 6250 '
  336. 6260 '
  337. 6270 '
  338. 6280 '
  339. 7000 ' SUBROUTINE ** Prevent illegal STRTADD$ entries (Ch. 10)
  340. 7010 '
  341. 7020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  342. 7030 IF STRTADD$ = "" THEN STRTADD$ = "N/A":GOTO 7200
  343. 7040 FOR CHECK = 1 TO LEN(STRTADD$)        ' Legal entries on next line
  344. 7050    IF ASC(MID$(STRTADD$,CHECK,1)) >= 45 AND ASC(MID$(STRTADD$,CHECK,1)) <= 122 THEN 7190 ' All numbers, letters, period, & dash
  345. 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
  346. 7070    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  347. 7080    PRINT CHR$(7)                ' Beep (Ch. 10)
  348. 7090    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  349. 7100    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  350. 7110    FOR COUNT = 1 TO 3            ' Blink error message
  351. 7120       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  352. 7130       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  353. 7140       PRINT FNCUR$(4,20);"Illegal Entry!"
  354. 7150       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  355. 7160    NEXT COUNT
  356. 7170    PRINT FNCUR$(5,8);"Please re-enter without punctuation."
  357. 7180    RETURN                    ' Go back to correct illegal entry
  358. 7190 NEXT CHECK
  359. 7200 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  360. 7210 RETURN                    ' No illegal entries, next INPUT
  361. 7220 '
  362. 7230 '
  363. 7240 '
  364. 7250 '
  365. 7260 '
  366. 8000 ' SUBROUTINE ** Prevent illegal CITY$ entries (Ch. 10)
  367. 8010 '
  368. 8020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  369. 8030 IF CITY$ = "" THEN CITY$ = "N/A":GOTO 8220
  370. 8040 FOR CHECK = 1 TO LEN(CITY$)        ' Legal entries on next line
  371. 8050    IF ASC(MID$(CITY$,CHECK,1)) >= 65 AND ASC(MID$(CITY$,CHECK,1)) <= 90 THEN 8210 ' A through Z
  372. 8060    IF ASC(MID$(CITY$,CHECK,1)) >= 97 AND ASC(MID$(CITY$,CHECK,1)) <= 122 THEN 8210 ' a through z
  373. 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
  374. 8080    IF ASC(MID$(CITY$,CHECK,1)) >= 45 AND ASC(MID$(CITY$,CHECK,1)) <= 46 THEN 8210 ' Dash & period
  375. 8090    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  376. 8100    PRINT CHR$(7)                ' Beep (Ch. 10)
  377. 8110    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  378. 8120    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  379. 8130    FOR COUNT = 1 TO 3            ' Blink error message
  380. 8140       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  381. 8150       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  382. 8160       PRINT FNCUR$(4,20);"Illegal Entry!"
  383. 8170       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  384. 8180    NEXT COUNT
  385. 8190    PRINT FNCUR$(5,8);"Please re-enter without punctuation."
  386. 8200    RETURN                    ' Go back to correct illegal entry
  387. 8210 NEXT CHECK
  388. 8220 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  389. 8230 RETURN                    ' No illegal entries, next INPUT
  390. 8240 '
  391. 8250 '
  392. 8260 '
  393. 8270 '
  394. 9000 ' SUBROUTINE ** Prevent illegal STATE$ entries (Ch. 10)
  395. 9010 '
  396. 9020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  397. 9030 IF STATE$ = "" THEN STATE$ = "N/A":GOTO 9220
  398. 9040 FOR CHECK = 1 TO LEN(STATE$)        ' Legal entries on next line
  399. 9050    IF ASC(MID$(STATE$,CHECK,1)) >= 65 AND ASC(MID$(STATE$,CHECK,1)) <= 90 THEN 9210 ' A through Z
  400. 9060    IF ASC(MID$(STATE$,CHECK,1)) >= 97 AND ASC(MID$(STATE$,CHECK,1)) <= 122 THEN 9210 ' a through z
  401. 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
  402. 9080    IF ASC(MID$(STATE$,CHECK,1)) >= 45 AND ASC(MID$(STATE$,CHECK,1)) <= 46 THEN 9210 ' Dash & period
  403. 9090    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  404. 9100    PRINT CHR$(7)                ' Beep (Ch. 10)
  405. 9110    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  406. 9120    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  407. 9130    FOR COUNT = 1 TO 3            ' Blink error message
  408. 9140       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  409. 9150       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  410. 9160       PRINT FNCUR$(4,20);"Illegal Entry!"
  411. 9170       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  412. 9180    NEXT COUNT
  413. 9190    PRINT FNCUR$(5,8);"Please re-enter without punctuation."
  414. 9200    RETURN                    ' Go back to correct illegal entry
  415. 9210 NEXT CHECK
  416. 9220 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  417. 9230 RETURN                    ' No illegal entries, next INPUT
  418. 9240 '
  419. 9250 '
  420. 9260 '
  421. 9270 '
  422. 9280 '
  423. 10000 ' SUBROUTINE ** Prevent illegal ZIP$ entries (Ch. 10)
  424. 10010 '
  425. 10020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  426. 10030 IF ZIP$ = "" THEN ZIP$ = "N/A":GOTO 10190
  427. 10040 FOR CHECK = 1 TO LEN(ZIP$)        ' Legal entries on next line
  428. 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
  429. 10060    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  430. 10070    PRINT CHR$(7)                ' Beep (Ch. 10)
  431. 10080    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  432. 10090    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  433. 10100    FOR COUNT = 1 TO 3            ' Blink error message
  434. 10110       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  435. 10120       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  436. 10130       PRINT FNCUR$(4,20);"Illegal Entry!"
  437. 10140       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  438. 10150    NEXT COUNT
  439. 10160    PRINT FNCUR$(5,9);"Please re-enter:  five digits only."
  440. 10170    RETURN                    ' Go back to correct illegal entry
  441. 10180 NEXT CHECK
  442. 10190 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  443. 10200 RETURN                    ' No illegal entries, next INPUT
  444. 10210 '
  445. 10220 '
  446. 10230 '
  447. 10240 '
  448. 10250 '
  449. 11000 ' SUBROUTINE ** Prevent illegal TELNUMBER$ entries (Ch. 10)
  450. 11010 '
  451. 11020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  452. 11030 IF TELNUMBER$ = "" THEN TELNUMBER$ = "N/A":GOTO 11190
  453. 11040 FOR CHECK = 1 TO LEN(TELNUMBER$)        ' Legal entries on next line
  454. 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
  455. 11060    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  456. 11070    PRINT CHR$(7)                ' Beep (Ch. 10)
  457. 11080    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  458. 11090    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  459. 11100    FOR COUNT = 1 TO 3            ' Blink error message
  460. 11110       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  461. 11120       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  462. 11130       PRINT FNCUR$(4,20);"Illegal Entry!"
  463. 11140       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  464. 11150    NEXT COUNT
  465. 11160    PRINT FNCUR$(5,6);"Please re-enter in the form XXX-XXX-XXXX."
  466. 11170    RETURN                    ' Go back to correct illegal entry
  467. 11180 NEXT CHECK
  468. 11190 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  469. 11200 RETURN                    ' No illegal entries, next INPUT
  470. 11210 '
  471. 11220 '
  472. 11230 '
  473. 11240 '
  474. 11250 '
  475. 12000 ' SUBROUTINE ** Prevent illegal PAID$ entries (Ch. 10)
  476. 12010 '
  477. 12020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  478. 12030 IF PAID$ = "" THEN PAID$ = "0":GOTO 12190
  479. 12040 FOR CHECK = 1 TO LEN(PAID$)        ' Legal entries on next line
  480. 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.)
  481. 12060    ILLEGAL = 1                ' Illegal entry found (Ch. 10)
  482. 12070    PRINT CHR$(7)                ' Beep (Ch. 10)
  483. 12080    PRINT FNCUR$(3,0);FNCLLN$        ' Clear third line from top
  484. 12090    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  485. 12100    FOR COUNT = 1 TO 3            ' Blink error message
  486. 12110       PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  487. 12120       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  488. 12130       PRINT FNCUR$(4,20);"Illegal Entry!"
  489. 12140       FOR PAUSE = 1 TO 100:NEXT PAUSE     ' Count to 100 silently (Ch. 7)
  490. 12150    NEXT COUNT
  491. 12160       PRINT FNCUR$(5,2);"Please re-enter:  Digits (& decimal pt) only."
  492. 12170    RETURN                    ' Go back to correct illegal entry
  493. 12180 NEXT CHECK
  494. 12190 GOSUB 13000                ' Replace INPUT instructions once illegal INPUT's corrected
  495. 12200 RETURN                    ' No illegal entries, next INPUT
  496. 12210 '
  497. 12220 '
  498. 12230 '
  499. 12240 '
  500. 12250 '
  501. 13000 ' SUBROUTINE ** Replace INPUT instructions after illegal INPUT's corrected
  502. 13010 '
  503. 13020 PRINT FNCUR$(3,0);"   * Edit by pressing entry's number."
  504. 13030 PRINT "   * Press  RETURN after each entry."
  505. 13040 PRINT "   * If information is not available, press RETURN."
  506. 13050 RETURN
  507. 13060 '
  508. 13070 '
  509. 13080 '
  510. 13090 '
  511. 13100 '
  512. 14000 ' SUBROUTINE ** Explanation of why no entry might have been found
  513. 14010 '
  514. 14020 PRINT TAB(10);"**  End of Membership List  **"
  515. 14030 PRINT:PRINT
  516. 14040 PRINT "  The entry you want isn't in the file the way"
  517. 14050 PRINT "  you entered it.  Did you enter it (including"
  518. 14060 PRINT "  capitalization  and punctuation)  the way it"
  519. 14070 PRINT "  originally appeared in the list?"
  520. 14080 RETURN
  521. 14090 '
  522. 14100 '
  523. 14110 '
  524. 14120 '
  525. 14130 '
  526. 15000 ' SUBROUTINE ** Prevent illegal FIRSTNAME$ entries (Ch. 10)
  527. 15010 '
  528. 15020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  529. 15030 IF FIRSTNAME$ = "" THEN FIRSTNAME$ = "N/A":GOTO 15220
  530. 15040 FOR CHECK = 1 TO LEN(FIRSTNAME$)        ' Legal entries on next line
  531. 15050    IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 65 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 90 THEN 15210 ' A through Z
  532. 15060    IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 97 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 122 THEN 15210 ' a through z
  533. 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
  534. 15080    IF ASC(MID$(FIRSTNAME$,CHECK,1)) >= 45 AND ASC(MID$(FIRSTNAME$,CHECK,1)) <= 46 THEN 15210 ' Dash & period
  535. 15090    ILLEGAL = 1                ' ILlegal entry found (Ch. 10)
  536. 15100    PRINT CHR$(7)                ' Beep (Ch. 10)
  537. 15110    PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  538. 15120    PRINT FNCUR$(6,0);FNCLLN$        ' Clear sixth line from top
  539. 15130    FOR COUNT = 1 TO 3            ' Bink error message
  540. 15140        PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  541. 15150        FOR PAUSE = 1 TO 100:NEXT PAUSE    ' Count to 100 silently (Ch. 7)
  542. 15160        PRINT FNCUR$(4,18);"Illegal Entry!"
  543. 15170        FOR PAUSE = 1 TO 100:NEXT PAUSE    ' Count to 100 silently (Ch. 7)
  544. 15180     NEXT COUNT
  545. 15190     PRINT FNCUR$(5,2);"Please re-enter without digits or punctuation."
  546. 15200     RETURN                    ' Go back to correct entry
  547. 15210 NEXT CHECK
  548. 15220 GOSUB 17000                ' Replace INPUT instructions once illegal INPUT's corrected
  549. 15230 RETURN                    ' No illegal entries, next INPUT
  550. 15240 '
  551. 15250 '
  552. 15260 '
  553. 15270 '
  554. 15280 '
  555. 16000 ' SUBROUTINE ** Prevent illegal LASTNAME$ entries (Ch. 10)
  556. 16010 '
  557. 16020 ILLEGAL = 0                ' No illegal entry yet, just checking (Ch. 10)
  558. 16030 IF LASTNAME$ = "" THEN LASTNAME$ = "N/A":GOTO 15220
  559. 16040 FOR CHECK = 1 TO LEN(LASTNAME$)        ' Legal entries on next line
  560. 16050   IF ASC(MID$(LASTNAME$,CHECK,1)) >= 65 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 90 THEN 16210 ' A through Z
  561. 16060   IF ASC(MID$(LASTNAME$,CHECK,1)) >= 97 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 122 THEN 16210 ' a through z
  562. 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
  563. 16080   IF ASC(MID$(LASTNAME$,CHECK,1)) >= 45 AND ASC(MID$(LASTNAME$,CHECK,1)) <= 46 THEN 16210 ' Dash & period
  564. 16090   ILLEGAL = 1                ' ILlegal entry found (Ch. 10)
  565. 16100   PRINT CHR$(7)                ' Beep (Ch. 10)
  566. 16110   PRINT FNCUR$(5,0);FNCLLN$        ' Clear fifth line from top
  567. 16120   PRINT FNCUR$(6,0);FNCLLN$        ' Clear sixth line from top
  568. 16130   FOR COUNT = 1 TO 3            ' Bink error message
  569. 16140        PRINT FNCUR$(4,0);FNCLLN$        ' Clear fourth line from top
  570. 16150        FOR PAUSE = 1 TO 100:NEXT PAUSE    ' Count to 100 silently (Ch. 7)
  571. 16160        PRINT FNCUR$(4,18);"Illegal Entry!"
  572. 16170        FOR PAUSE = 1 TO 100:NEXT PAUSE    ' Count to 100 silently (Ch. 7)
  573. 16180     NEXT COUNT
  574. 16190     PRINT FNCUR$(5,2);"Please re-enter without digits or punctuation."
  575. 16200     RETURN                    ' Go back to correct entry
  576. 16210 NEXT CHECK
  577. 16220 GOSUB 17000                ' Replace INPUT instructions once illegal INPUT's corrected
  578. 16230 RETURN                    ' No illegal entries
  579. 16240 '
  580. 16250 '
  581. 16260 '
  582. 16270 '
  583. 16280 '
  584. 17000 ' SUBROUTINE ** Replace INPUT instructions after illegal INPUT's corrected
  585. 17010 '
  586. 17020 PRINT FNCUR$(4,0);"  Enter the  first and last  names of the  person"
  587. 17030 PRINT "  whose address  and telephone number you want to"
  588. 17040 PRINT FNCLLN$;"  edit."
  589. 17050 RETURN
  590. 17060 '
  591. 17070 '
  592. 17080 '
  593. 17090 '
  594. 17100 '
  595. 20000 ' ** Error Traps ** (Ch. 10)
  596. 20010 '
  597. 20020 IF ERR <> 53 AND ERL <> 300 THEN 20210    ' Trap File not Found in line 300
  598. 20030 PRINT CHR$(7)                ' Beep (Ch. 10)
  599. 20040 PRINT CL$                    ' Clear screen (Ch. 7)
  600. 20050 PRINT
  601. 20060 PRINT TAB(17);"***   Error   ***"
  602. 20070 PRINT:PRINT:PRINT:PRINT            ' 4 blank lines
  603. 20080 PRINT "There is no membership list on the diskette in B:."
  604. 20090 PRINT:PRINT:PRINT:PRINT            ' 4 blank lines
  605. 20100 PRINT TAB(4);"You can't edit a list that doesn't exist."
  606. 20110 PRINT:PRINT:PRINT:PRINT            ' 4 blank lines
  607. 20120 PRINT "Please press any key to return to the MAIN MENU."
  608. 20130 IF INKEY$ = "" THEN 20130            ' Wait for keypress (Ch. 7)
  609. 20140 PRINT:PRINT:PRINT:RESUME 2180        ' Return to MAIN MENU
  610. 20150 '
  611. 20160 '
  612. 20170 '
  613. 20180 '
  614. 20190 '
  615. 20200 '
  616. 20210 ' Catch-all Error Trap (Ch. 10)
  617. 20220 '
  618. 20230 PRINT CHR$(7)                ' Beep (Ch. 10)
  619. 20240 PRINT CL$                    ' Clear screen (Ch. 7)
  620. 20250 PRINT:PRINT                ' 2 blank lines
  621. 20260 PRINT "You have generated error number";ERR
  622. 20270 PRINT "on line number";ERL;"."
  623. 20280 PRINT
  624. 20290 PRINT "Please write this fact down.  Also write down ex-"
  625. 20300 PRINT "actly what you did before this error took place."
  626. 20310 PRINT
  627. 20320 PRINT "Ask a BASIC  programmer what the error means and" 
  628. 20330 PRINT "how to correct it."
  629. 20340 PRINT:PRINT                ' 2 blank lines
  630. 20350 PRINT "Press any key to return to the MAIN MENU."
  631. 20360 IF INKEY$ = "" THEN 20360            ' Waiting for keypress (Ch. 7)
  632. 20370 PRINT:PRINT:RESUME 2180            ' Return to MAIN MENU
  633. NU."
  634. 20360 IF INKEY$ = "" THEN 20360            ' Waiting for keypress (Ch. 7)
  635. 20370 PRINT:PRINT:RESUM