10 ' ********************************************** 20 ' ********************************************** 30 ' *** K-TMENU *** 40 ' *** PART OF A CLUB MEMBERSHIP SOFTWARE *** 50 ' *** 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 TRY TO RUN K-TMENU ALONE. IT *** 130 ' *** CHAINS INTO K-TMAKE, K-TEDIT, K-TSERCH,*** 140 ' *** AND K-TSORT, ALL OF WHICH MUST RESIDE *** 150 ' *** ON THE DISK WITH K-TMENU. ALL OF THE *** 160 ' *** ABOVE ARE .BAS FILES. *** 170 ' ********************************************** 180 ' ********************************************** 190 ' 200 ' 210 CL$=CHR$(26) ' Define Osborne 1 clear screen (Ch. 7) 220 RECORDTOTAL = 0 ' Number of records to start (Ch. 9) 230 COMMON CL$,RECORDTOTAL ' Pass variables to other programs (Ch. 11) 240 GOSUB 1000 ' Sign-on & explanations (Chs. 5 & 7) 250 ON ERROR GOTO 20000 ' Error traps (Ch. 10) 260 GOSUB 2000 ' Check for B:K-T.LST's existence (Ch. 10) 270 ' 280 ' Main Menu 290 ' 300 ' Define Osborne 1 cursor control (Ch. 8) 310 DEF FNCUR$(VERT,HORZ) = CHR$(27)+CHR$(61)+CHR$(32+VERT)+CHR$(32+HORZ) 320 DEF FNCLLN$ = CHR$(27)+CHR$(84) ' Define Osborne 1 clear line (Ch. 8) 330 ' 340 ' 350 ' 360 ' 370 ' 380 PRINT CL$ ' Clear screen (Ch. 7) 390 PRINT:PRINT:PRINT ' 3 blank lines 400 PRINT TAB(8);"*** KEEP-TRAK MAIN MENU ***" 410 PRINT:PRINT:PRINT ' 3 blank lines 420 PRINT TAB(5);"1 - Create or add to the membership list" 430 PRINT TAB(5);"2 - Edit (i.e., change) an existing list" 440 PRINT TAB(5);"3 - Print/display membership list entries" 450 PRINT TAB(5);"4 - Print alphabetized membership list and" 460 PRINT TAB(9);"list of non-paying members" 470 PRINT TAB(5);"5 - Change data disk in B:" 480 PRINT TAB(5);"6 - Session over: exit from KEEP-TRAK" 490 PRINT:PRINT:PRINT ' 3 blank lines 500 PRINT TAB(15);"Please choose by number." 510 CHOICE$ = INKEY$ ' Wait for keypress (Ch. 7) 520 IF CHOICE$ = "" THEN 510 ' CHAINing is in Ch. 11 530 IF CHOICE$ = "1" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TMAKE" 540 IF CHOICE$ = "2" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TEDIT" 550 IF CHOICE$ = "3" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TSERCH" 560 IF CHOICE$ = "4" THEN PRINT:PRINT TAB(12);"Please wait. Loading program.":CHAIN "K-TSORT" 570 IF CHOICE$ = "5" THEN GOSUB 4000:GOTO 250 ' To beginning: check new disk 580 IF CHOICE$ = "6" THEN PRINT CL$:PRINT:PRINT:PRINT TAB(14);"Thanks for a good session.":END 590 ' 600 ' 610 ' Catch illegal inputs (Ch. 8) (Ch. 11 for indentations of lines 650-680) 620 ' 630 PRINT CHR$(7) ' Beep the beeper (Ch. 10) 640 FOR COUNT = 1 TO 3 ' Do the following 3 times 650 PRINT FNCUR$(18,14);FNCLLN$ ' Clear "Please choose" line 660 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Pause: count to 100 670 PRINT FNCUR$(18,17);"Please choose 1-6" 680 FOR PAUSE = 1 TO 100:NEXT PAUSE ' Pause: count to 100 690 NEXT COUNT ' Increase COUNT 700 GOTO 510 710 ' 720 ' 730 ' 740 ' 750 ' 1000 ' SUBROUTINE ** Sign-on & instructions (Ch. 7) 1010 ' 1020 PRINT CL$ ' Clear screen (Ch. 7) 1030 PRINT:PRINT TAB(23);"KEEP-TRAK" 1040 PRINT TAB(12);"A CLUB MEMBERSHIP FILING SYSTEM" 1050 PRINT TAB(15);"WRITTEN BY HARVEY G. LORD" 1051 PRINT:PRINT:PRINT:PRINT "Complete documentation for KEEP-TRAK including how" 1052 PRINT "to modify it for your own uses is found in BEYOND" 1053 PRINT "GAMES and FRIENDLY SOFTWARE by Harvey G. Lord," 1054 PRINT "Atheneum Publishers, copyright 1985.":PRINT 1055 PRINT:PRINT "KEEP-TRAK is released for non-commercial use only." 1056 PRINT "This release notice may not be removed." 1057 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT TAB(13);"PRESS ANY KEY TO CONTINUE"; 1060 WHILE INKEY$ = "":WEND 1070 ' 1080 ' 1090 ' Starting instructions 1100 ' 1110 ' 1120 PRINT CL$ ' Clear screen (Ch. 7) 1130 PRINT:PRINT ' 2 blank lines 1140 PRINT TAB(6);"*** STARTING INSTRUCTIONS ***" 1150 PRINT:PRINT:PRINT ' 3 blank lines 1160 PRINT "* KEEP-TRAK is self-explanatory. Follow screen" 1170 PRINT " instructions as they appear." 1180 PRINT 1190 PRINT "* To create a new membership list file, write the" 1200 PRINT " list's name on a diskette label. Stick the" 1210 PRINT " label onto the top right front corner of a" 1220 PRINT " blank, formatted diskette. Place the dis-" 1230 PRINT " kette in drive B: and close the drive door." 1240 PRINT 1250 PRINT "* Working with previously created lists, place" 1260 PRINT " the diskette holding the mailing list you" 1270 PRINT " need in drive B: and close the drive door." 1280 PRINT:PRINT 1290 PRINT TAB(2);"Place disk in B: and press any key to continue." 1300 IF INKEY$ = "" THEN 1300 ' Wait for keypress (Ch. 7) 1310 RETURN ' End of subroutine (Ch. 5) 1320 ' 1330 ' 1340 ' 1350 ' 1360 ' 2000 ' SUBROUTINE ** Check for B:K-T.LST's existence (Ch. 10) 2010 ' 2020 OPEN "I",#1,"B:K-T.LST" ' Open file in INPUT mode (Ch. 3) 2030 ' 2040 ' Lines 2050-2320 execute only if B:K-T.LST exists. 2050 RECORDTOTAL = 0:MONEY = 0 ' Set variables to 0 to start 2060 PRINT CL$ ' Clear screen (Ch. 7) 2070 PRINT TAB(12);"Checking membership file" ' Count members in file (Ch. 9) 2080 IF EOF(1) THEN CLOSE#1:GOTO 2130 ' Check for end-of-file (Ch. 2) 2090 INPUT#1,FIRSTNM$,LASTNM$,STRTADD$,CITY$,STATE$,ZIP$,TELNUMBER$,PAID$ 2100 RECORDTOTAL = RECORDTOTAL + 1 ' Increase record counter (Ch. 9) 2110 MONEY = MONEY + VAL(PAID$) ' Total in club treasury (Ch. 9) 2120 GOTO 2080 ' Loop back for next record 2130 IF RECORDTOTAL = 0 THEN KILL "B:K-T.LST":GOTO 2000 ' Erase empty file 2140 PRINT 2150 PRINT "The membership file on B: has";RECORDTOTAL;"members in it." 2160 PRINT 2170 GOSUB 3000 ' Password protected treasury total 2180 PRINT "You may add, edit, or view entries, search for" 2190 PRINT "specific entries, print one or all entries in" 2200 PRINT "alphabetical order or in the order they've been" 2210 PRINT "entered, or print names of members who have not" 2220 PRINT "paid their dues." 2230 PRINT 2240 PRINT "If you create a new membership file (selection 1" 2250 PRINT "on the forthcoming menu), the old file can be" 2260 PRINT "erased." 2270 PRINT 2280 PRINT "Consider this when making a selection from the" 2290 PRINT "MAIN MENU, the next screen you'll see." 2300 PRINT 2310 PRINT TAB(8);"Press any key for the MAIN MENU." 2320 IF INKEY$ = "" THEN 2320 ' Wait for keypress (Ch. 7) 2330 RETURN ' End of subroutine (Ch. 5) 2340 ' 2350 ' 2360 ' 2370 ' 2380 ' 3000 ' SUBROUTINE ** Password protected treasury total (Ch. 9) 3010 ' 3020 PRINT "Please enter the password to see how much money" 3030 LINE INPUT "is in the club treasury: ";PASSWORD$ 3040 PRINT 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." 3060 PRINT 3070 RETURN 3080 ' 3090 ' 3100 ' 3110 ' 3120 ' 3130 ' 4000 ' SUBROUTINE ** Prompt for changing data disk in B: 4010 ' 4020 PRINT CL$ ' Clear screen (Ch. 7) 4030 PRINT:PRINT:PRINT ' 3 blank lines 4040 PRINT TAB(9);"** Change Data Disk in Drive B: **" 4050 PRINT:PRINT:PRINT ' 3 blank lines 4060 PRINT TAB(9);"Remove the data disk from drive B:." 4070 PRINT:PRINT:PRINT ' 3 blank lines 4080 PRINT TAB(10);"Replace it with a new data disk." 4090 PRINT:PRINT:PRINT ' 3 blank lines 4100 PRINT TAB(13);"Press any key to continue." 4110 IF INKEY$ = "" THEN 4110 ' Wait for keypress (Ch. 7) 4120 RESET ' Prepare for new data disk (Ch. 10) 4130 RETURN 4140 ' 4150 ' 4160 ' 4170 ' 4180 ' 20000 ' ** Error Traps ** 20010 ' 20020 ' Trap "File not found" in line 2020 (Ch. 10) 20030 ' 20040 IF ERR<>53 AND ERL<>2020 THEN 20300 ' Trap File not Found in line 2020 (Ch. 10) 20050 PRINT CL$ ' Clear screen (Ch. 7) 20060 PRINT TAB(15);"*** NOTE ***" 20070 PRINT:PRINT ' 2 blank lines 20080 PRINT TAB(2);"There is no membership list file on the diskette" 20090 PRINT TAB(2);"in drive B:." 20100 PRINT 20110 PRINT TAB(2);"Therefore, you may create one, but cannot edit," 20120 PRINT TAB(2);"search through, print, or alphabetize one." 20130 PRINT 20140 PRINT TAB(2);"Consider this when making a selection from the" 20150 PRINT TAB(2);"MAIN MENU." 20160 PRINT 20170 PRINT TAB(2);"If you want to change disks in drive B:, do it," 20180 PRINT TAB(2);"then choose selection #5 from the MAIN MENU to" 20190 PRINT TAB(2);"reset the disk drives. Change disks *ONLY* from" 20200 PRINT TAB(2);"selection #5 on the MAIN MENU." 20210 PRINT:PRINT:PRINT ' 3 blank lines 20220 PRINT TAB(6);"Press any key for the KEEP-TRAK MAIN MENU." 20230 IF INKEY$ = "" THEN 20230 ' Wait for keypress (Ch. 7) 20240 RESUME 280 ' End of error trap (Ch. 10) 20250 ' 20260 ' 20270 ' 20280 ' 20290 ' 20300 ' General Catch-all Error Trap (Ch. 10) 20310 ' 20320 PRINT CHR$(7) ' Beep the beeper (Ch. 10) 20330 PRINT CL$ ' Clear screen (Ch. 7) 20340 PRINT:PRINT ' 2 blank lines 20350 PRINT "You have generated error number ";ERR 20360 PRINT "on line number ";ERL;"." 20370 PRINT 20380 PRINT "Please write this fact down. Also write down ex-" 20390 PRINT "actly what you did before this error took place." 20400 PRINT 20410 PRINT "Ask a BASIC programmer what the error means and" 20420 PRINT "how to correct it." 20430 PRINT:PRINT ' 2 blank lines 20440 PRINT "Press any key for the KEEP-TRAK MAIN MENU." 20450 IF INKEY$ = "" THEN 20450 ' Wait for keypress (Ch. 7) 20460 RESUME 280 ' End of error trap (Ch. 10)