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-TMENU.BZS / K-TMENU.BAS
BASIC Source File  |  2000-06-30  |  10KB  |  240 lines

  1. 10  ' **********************************************
  2. 20  ' **********************************************
  3. 30  ' ***               K-TMENU                  ***
  4. 40  ' ***   PART OF A CLUB MEMBERSHIP SOFTWARE   ***
  5. 50  ' ***     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 TRY TO RUN K-TMENU ALONE. IT   ***
  13. 130 ' *** CHAINS INTO K-TMAKE, K-TEDIT, K-TSERCH,***
  14. 140 ' *** AND K-TSORT,  ALL OF WHICH MUST RESIDE ***
  15. 150 ' *** ON THE DISK WITH K-TMENU.   ALL OF THE ***
  16. 160 ' *** ABOVE ARE .BAS FILES.                  ***
  17. 170 ' **********************************************
  18. 180 ' **********************************************
  19. 190 '
  20. 200 '
  21. 210 CL$=CHR$(26)                  ' Define Osborne 1 clear screen (Ch. 7)
  22. 220 RECORDTOTAL = 0                ' Number of records to start (Ch. 9)
  23. 230 COMMON CL$,RECORDTOTAL            ' Pass variables to other programs (Ch. 11)
  24. 240 GOSUB 1000                    ' Sign-on & explanations (Chs. 5 & 7)
  25. 250 ON ERROR GOTO 20000                ' Error traps (Ch. 10)
  26. 260 GOSUB 2000                    ' Check for B:K-T.LST's existence (Ch. 10)
  27. 270 '
  28. 280 ' Main Menu
  29. 290 '
  30. 300 ' Define Osborne 1 cursor control   (Ch. 8)
  31. 310 DEF FNCUR$(VERT,HORZ) = CHR$(27)+CHR$(61)+CHR$(32+VERT)+CHR$(32+HORZ)
  32. 320 DEF FNCLLN$ = CHR$(27)+CHR$(84)        ' Define Osborne 1 clear line (Ch. 8)
  33. 330 '
  34. 340 '
  35. 350 '
  36. 360 '
  37. 370 '
  38. 380 PRINT CL$                    ' Clear screen (Ch. 7)
  39. 390 PRINT:PRINT:PRINT                ' 3 blank lines
  40. 400 PRINT TAB(8);"***      KEEP-TRAK MAIN MENU      ***"
  41. 410 PRINT:PRINT:PRINT                ' 3 blank lines
  42. 420 PRINT TAB(5);"1 - Create  or add to the  membership  list"
  43. 430 PRINT TAB(5);"2 - Edit  (i.e.,  change) an existing  list"
  44. 440 PRINT TAB(5);"3 - Print/display  membership list  entries"
  45. 450 PRINT TAB(5);"4 - Print  alphabetized membership list and"
  46. 460 PRINT TAB(9);"list of non-paying members"
  47. 470 PRINT TAB(5);"5 - Change data disk in B:"
  48. 480 PRINT TAB(5);"6 - Session over:  exit from KEEP-TRAK"
  49. 490 PRINT:PRINT:PRINT                ' 3 blank lines
  50. 500 PRINT TAB(15);"Please choose by number."
  51. 510 CHOICE$ = INKEY$                ' Wait for keypress (Ch. 7)
  52. 520 IF CHOICE$ = "" THEN 510            ' CHAINing is in Ch. 11
  53. 530 IF CHOICE$ = "1" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TMAKE"
  54. 540 IF CHOICE$ = "2" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TEDIT"
  55. 550 IF CHOICE$ = "3" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TSERCH"
  56. 560 IF CHOICE$ = "4" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TSORT"
  57. 570 IF CHOICE$ = "5" THEN GOSUB 4000:GOTO 250    ' To beginning: check new disk
  58. 580 IF CHOICE$ = "6" THEN PRINT CL$:PRINT:PRINT:PRINT TAB(14);"Thanks for a good session.":END
  59. 590 '
  60. 600 '
  61. 610 ' Catch illegal inputs (Ch. 8) (Ch. 11 for indentations of lines 650-680)
  62. 620 '
  63. 630 PRINT CHR$(7)                ' Beep the beeper  (Ch. 10)
  64. 640 FOR COUNT = 1 TO 3                ' Do the following 3 times
  65. 650    PRINT FNCUR$(18,14);FNCLLN$        ' Clear "Please choose" line
  66. 660    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Pause: count to 100
  67. 670    PRINT FNCUR$(18,17);"Please choose 1-6"
  68. 680    FOR PAUSE = 1 TO 100:NEXT PAUSE        ' Pause: count to 100
  69. 690 NEXT COUNT                    ' Increase COUNT
  70. 700 GOTO 510
  71. 710 '
  72. 720 '
  73. 730 '
  74. 740 '
  75. 750 '
  76. 1000 ' SUBROUTINE ** Sign-on & instructions (Ch. 7)
  77. 1010 '
  78. 1020 PRINT CL$                    ' Clear screen (Ch. 7)
  79. 1030 PRINT:PRINT TAB(23);"KEEP-TRAK"
  80. 1040 PRINT TAB(12);"A CLUB MEMBERSHIP FILING SYSTEM"
  81. 1050 PRINT TAB(15);"WRITTEN BY HARVEY G. LORD"
  82. 1051 PRINT:PRINT:PRINT:PRINT "Complete documentation for KEEP-TRAK including how"
  83. 1052 PRINT "to modify it for your own  uses is found in BEYOND"
  84. 1053 PRINT "GAMES and  FRIENDLY  SOFTWARE  by  Harvey G. Lord,"
  85. 1054 PRINT "Atheneum Publishers, copyright 1985.":PRINT
  86. 1055 PRINT:PRINT "KEEP-TRAK is released for non-commercial use only."
  87. 1056 PRINT "This release notice may not be removed."
  88. 1057 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT TAB(13);"PRESS ANY KEY TO CONTINUE";
  89. 1060 WHILE INKEY$ = "":WEND
  90. 1070 ' 
  91. 1080 '
  92. 1090 ' Starting instructions
  93. 1100 '
  94. 1110 '
  95. 1120 PRINT CL$                    ' Clear screen (Ch. 7)
  96. 1130 PRINT:PRINT                ' 2 blank lines
  97. 1140 PRINT TAB(6);"***      STARTING INSTRUCTIONS      ***"
  98. 1150 PRINT:PRINT:PRINT                ' 3 blank lines
  99. 1160 PRINT "* KEEP-TRAK  is self-explanatory.   Follow screen"
  100. 1170 PRINT "  instructions as they appear."
  101. 1180 PRINT
  102. 1190 PRINT "* To create a new membership list file, write the"
  103. 1200 PRINT "  list's  name on a  diskette  label.  Stick  the"
  104. 1210 PRINT "  label  onto  the top  right  front  corner of a"
  105. 1220 PRINT "  blank,  formatted  diskette.    Place  the dis-"
  106. 1230 PRINT "  kette in drive B: and close the drive door."
  107. 1240 PRINT
  108. 1250 PRINT "* Working  with previously  created lists,  place"
  109. 1260 PRINT "  the  diskette  holding  the  mailing  list  you"
  110. 1270 PRINT "  need in drive B: and close the drive door."
  111. 1280 PRINT:PRINT
  112. 1290 PRINT TAB(2);"Place disk in B: and press any key to continue."
  113. 1300 IF INKEY$ = "" THEN 1300            ' Wait for keypress (Ch. 7)
  114. 1310 RETURN                    ' End of subroutine (Ch. 5)
  115. 1320 '
  116. 1330 '
  117. 1340 '
  118. 1350 '
  119. 1360 '
  120. 2000 ' SUBROUTINE ** Check for B:K-T.LST's existence    (Ch. 10)
  121. 2010 '
  122. 2020 OPEN "I",#1,"B:K-T.LST"            ' Open file in INPUT mode (Ch. 3)
  123. 2030 '
  124. 2040 ' Lines 2050-2320 execute only if B:K-T.LST exists.
  125. 2050 RECORDTOTAL = 0:MONEY = 0            ' Set variables to 0 to start
  126. 2060 PRINT CL$                    ' Clear screen (Ch. 7)
  127. 2070 PRINT TAB(12);"Checking membership file"     ' Count members in file (Ch. 9)
  128. 2080 IF EOF(1) THEN CLOSE#1:GOTO 2130    ' Check for end-of-file (Ch. 2)
  129. 2090 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$
  130. 2100 RECORDTOTAL = RECORDTOTAL + 1        ' Increase record counter (Ch. 9)
  131. 2110 MONEY = MONEY + VAL(PAID$)            ' Total in club treasury (Ch. 9)
  132. 2120 GOTO 2080                    ' Loop back for next record
  133. 2130 IF RECORDTOTAL = 0 THEN KILL "B:K-T.LST":GOTO 2000 ' Erase empty file
  134. 2140 PRINT
  135. 2150 PRINT "The membership file on B: has";RECORDTOTAL;"members in it."
  136. 2160 PRINT
  137. 2170 GOSUB 3000                    ' Password protected treasury total
  138. 2180 PRINT "You may add,  edit, or view entries,  search for"
  139. 2190 PRINT "specific  entries,  print one or all  entries in"
  140. 2200 PRINT "alphabetical  order or in the order they've been"
  141. 2210 PRINT "entered,  or print names of members who have not"
  142. 2220 PRINT "paid their dues."
  143. 2230 PRINT
  144. 2240 PRINT "If you create a new membership file (selection 1"
  145. 2250 PRINT "on the forthcoming  menu),  the old  file can be"
  146. 2260 PRINT "erased."
  147. 2270 PRINT
  148. 2280 PRINT "Consider  this when  making a selection from the"
  149. 2290 PRINT "MAIN MENU, the next screen you'll see."
  150. 2300 PRINT
  151. 2310 PRINT TAB(8);"Press any key for the MAIN MENU."
  152. 2320 IF INKEY$ = "" THEN 2320             ' Wait for keypress (Ch. 7)
  153. 2330 RETURN                     ' End of subroutine (Ch. 5)
  154. 2340 '
  155. 2350 '
  156. 2360 '
  157. 2370 '
  158. 2380 '
  159. 3000 ' SUBROUTINE ** Password protected treasury total (Ch. 9)
  160. 3010 '
  161. 3020 PRINT "Please enter the password to see how much money"
  162. 3030 LINE INPUT "is in the club treasury:  ";PASSWORD$
  163. 3040 PRINT
  164. 3050 IF PASSWORD$ = "CASH" THEN PRINT "The club's treasury has $";MONEY;"in it." ELSE PRINT "Sorry, I can't reveal the amount in the treasury."
  165. 3060 PRINT
  166. 3070 RETURN
  167. 3080 '
  168. 3090 '
  169. 3100 '
  170. 3110 '
  171. 3120 '
  172. 3130 '
  173. 4000 ' SUBROUTINE ** Prompt for changing data disk in B:
  174. 4010 '
  175. 4020 PRINT CL$                    ' Clear screen (Ch. 7)
  176. 4030 PRINT:PRINT:PRINT                ' 3 blank lines
  177. 4040 PRINT TAB(9);"**  Change Data Disk in Drive B: **"
  178. 4050 PRINT:PRINT:PRINT                ' 3 blank lines
  179. 4060 PRINT TAB(9);"Remove the data disk from drive B:."
  180. 4070 PRINT:PRINT:PRINT                ' 3 blank lines
  181. 4080 PRINT TAB(10);"Replace it with a new data disk."
  182. 4090 PRINT:PRINT:PRINT                ' 3 blank lines
  183. 4100 PRINT TAB(13);"Press any key to continue."
  184. 4110 IF INKEY$ = "" THEN 4110            ' Wait for keypress (Ch. 7)
  185. 4120 RESET                    ' Prepare for new data disk (Ch. 10)
  186. 4130 RETURN
  187. 4140 '
  188. 4150 '
  189. 4160 '
  190. 4170 '
  191. 4180 '
  192. 20000 ' ** Error Traps **
  193. 20010 '
  194. 20020 ' Trap "File not found" in line 2020  (Ch. 10)
  195. 20030 '
  196. 20040 IF ERR<>53 AND ERL<>2020 THEN 20300     ' Trap File not Found in line 2020 (Ch. 10)
  197. 20050 PRINT CL$                     ' Clear screen (Ch. 7)
  198. 20060 PRINT TAB(15);"***     NOTE     ***"
  199. 20070 PRINT:PRINT                 ' 2 blank lines
  200. 20080 PRINT TAB(2);"There is no membership  list file on the diskette"
  201. 20090 PRINT TAB(2);"in drive B:."
  202. 20100 PRINT
  203. 20110 PRINT TAB(2);"Therefore,  you may create one,  but cannot edit,"
  204. 20120 PRINT TAB(2);"search through, print, or alphabetize one."
  205. 20130 PRINT 
  206. 20140 PRINT TAB(2);"Consider  this when  making a selection  from the"
  207. 20150 PRINT TAB(2);"MAIN MENU."
  208. 20160 PRINT
  209. 20170 PRINT TAB(2);"If you  want to change  disks in drive B:, do it,"
  210. 20180 PRINT TAB(2);"then  choose selection #5 from the  MAIN  MENU to"
  211. 20190 PRINT TAB(2);"reset the disk drives.   Change disks *ONLY* from"
  212. 20200 PRINT TAB(2);"selection #5 on the MAIN MENU."
  213. 20210 PRINT:PRINT:PRINT                ' 3 blank lines
  214. 20220 PRINT TAB(6);"Press any key for the KEEP-TRAK MAIN MENU."
  215. 20230 IF INKEY$ = "" THEN 20230            ' Wait for keypress (Ch. 7)
  216. 20240 RESUME 280                 ' End of error trap (Ch. 10)
  217. 20250 '
  218. 20260 '
  219. 20270 '
  220. 20280 '
  221. 20290 '
  222. 20300 ' General Catch-all Error Trap  (Ch. 10)
  223. 20310 '
  224. 20320 PRINT CHR$(7)                 ' Beep the beeper  (Ch. 10)
  225. 20330 PRINT CL$                     ' Clear screen (Ch. 7)
  226. 20340 PRINT:PRINT                 ' 2 blank lines
  227. 20350 PRINT "You have generated error number ";ERR
  228. 20360 PRINT "on line number ";ERL;"."
  229. 20370 PRINT
  230. 20380 PRINT "Please write this fact down.  Also write down ex-"
  231. 20390 PRINT "actly what you did before this error took place."
  232. 20400 PRINT
  233. 20410 PRINT "Ask a BASIC  programmer what the  error means and"
  234. 20420 PRINT "how to correct it."
  235. 20430 PRINT:PRINT                 ' 2 blank lines
  236. 20440 PRINT "Press any key for the KEEP-TRAK MAIN MENU."
  237. 20450 IF INKEY$ = "" THEN 20450             ' Wait for keypress (Ch. 7)
  238. 20460 RESUME 280                 ' End of error trap (Ch. 10)
  239. AIN MENU."
  240. 20450 IF INKEY$