start tok64 d64-Ndj294 100 REM this program is to be used as 110 REM an address book. to get a copy 120 REM of it, contact joe spurlock 130 REM at 589-0004. i will give it to 140 REM you for $1. thank you. 150 REM joe spurlock 160 REM computer science i 170 REM period 4 180 REM january 10, 1985 190 REM 200 PRINTCHR$(14) 210 REM f$=first name, la$=last name,sa$= street address, c$=city, s$=state 220 POKE53280,0:POKE53281,0:POKE646,4:REM z$=zip code, pn$=phone number 230 REM aa$,ab$,ac$,ad$,ae$,af,ag$,l$,o$ are switching variables 240 DIMf$(200),la$(200),sa$(200),c$(200),s$(200),z$(200),pn$(200),aa$(200),ab$(200) 250 DIMac$(200),ad$(200),ae$(200),af$(200),ag$(200),l$(200),o$(200) 260 REM******************************** 270 REM******* first menu ******** 280 REM******************************** 290 GOSUB 2560 300 PRINT"{clear}{orange}{down*4}{right*13}First Menu{cyan} 305 PRINT"{cyan}{down*4}{right*10}1. Build a File 310 PRINT"{down}{right*10}2. Edit a File 320 PRINT"{down*2}{right*12}YOUR{sh space}CHOICE" 330 GETg$:IFg$=""THEN330 340 g=VAL(g$):ONgGOTO680,890 350 GOTO 300 360 REM******************************* 370 REM****** second menu *********** 380 REM******************************* 390 PRINT"{clear}{right*14}{orange}Master Menu{cyan} 395 PRINT"{home}{down*4}{right*10}1. Add a Name 400 PRINT"{down}{right*10}2. Delete a Name 410 PRINT"{down}{right*10}3. Change a Name 420 PRINT"{down}{right*10}4. Print the List 430 PRINT"{down}{right*10}5. Search for a Name 440 PRINT"{down}{right*10}6. Write the List to Disk" 450 PRINT"{down}{right*10}7. Go back to the First Menu" 455 PRINT"{down}{right*10}8. End" 460 PRINT"{down*2}{right*10}INPUT{sh space}YOUR{sh space}CHOICE 470 GET k$:IFk$=""THEN470 480 k=VAL(k$):ONkGOSUB1040,1220,1400,1640,1750,1840,300,1950 490 GOTO 390 500 REM****************************** 510 REM***** searching routine ****** 520 REM****************************** 530 INPUT"{clear}{down*7}What is the {reverse on}LAST NAME{reverse off}";la$ 531 PRINT"{clear}{down*4}{right*16}{red}Searching{cyan}" 540 e=0:FORf=1TOn 550 IFla$<>la$(f)THEN590 560 PRINT"{down*2}";f$(f);" ";la$(f):PRINTsa$(f):PRINTc$(f);"{space*2}";s$(f):PRINT" ",z$(f):PRINT:PRINTTAB(20)pn$(f) 570 INPUT"{down}Is this the record";y$ 580 IFy$="y"ORy$="yes"THEN620 590 PRINT"{clear}": NEXTf 600 PRINT"{down*4}{red}Record Not Found{cyan}" 610 FORp=1TO1000:NEXTp:e=1 620 RETURN 630 REM******************************* 640 REM****** build ******** 650 REM****** a ******** 660 REM****** file ******** 670 REM******************************* 680 OPEN15,8,15:x$=CHR$(13):PRINT#15,"i0" 690 INPUT"{clear}{down*4}What is the {reverse on}{red}FILENAME{reverse off}{cyan}";n$:OPEN2,8,2,"0:"+n$+",s,w" 700 INPUT#15,e,e$,e1,e2:IFeTHENPRINT"{down*10}error:",e$:CLOSE2:CLOSE15:GOTO810 710 PRINT"{clear}{down}What is the{red}:{cyan}" 720 INPUT"{down*2}First Name {red}";f$: 730 INPUT"{cyan}Last Name {red}";la$: 740 INPUT"{cyan}Street Address {red}";sa$: 750 INPUT"{cyan}City {red}";c$: 760 INPUT"{cyan}State {red}";s$: 770 INPUT"{cyan}Zip Code {red}";z$: 780 INPUT"{cyan}Phone Number {red}";pn$: 790 PRINT#2,f$;x$;la$;x$;sa$;x$;c$;x$;s$;x$;z$;x$;pn$;x$; 800 CLOSE2:CLOSE15:PRINT"{cyan}File {red}";n$;"{cyan} is Written." 810 PRINT"{down*2}PRESS{sh space}ANY{sh space}KEY{sh space}TO{sh space}CONTINUE" 820 GETg$:IFg$=""THEN820 830 GOTO300 840 REM****************************** 850 REM****** read ******** 860 REM****** in ******** 870 REM****** routine ******** 880 REM****************************** 890 REM 900 INPUT"{clear}{down*4}Enter the {reverse on}{red}Filename{reverse off}{cyan}";n$ 901 OPEN15,8,15,"i0" 910 OPEN1,8,2,n$ 911 INPUT#15,e,e$,e1,e2 912 IFeTHENPRINT"{red}{down*2}There is no file called ";n$;".":CLOSE15:CLOSE1:GOTO 810 920 j=0 930 j=j+1 940 INPUT#1,f$(j),la$(j),sa$(j),c$(j),s$(j),z$(j),pn$(j) 950 IF st=0 THEN930 960 n=j 970 CLOSE1:CLOSE15:b=n 980 PRINT"{down*3}There are{red}";n;"{cyan}Records Under {red}";n$;"{cyan}.":FORp=1TO1000:NEXTp:d=1:GOTO390 990 REM****************************** 1000 REM****** add ******** 1010 REM****** a ******** 1020 REM****** record ******** 1030 REM****************************** 1040 PRINT"{cyan}{clear}{right*13}Adding a Name" 1041 PRINT"{cyan}{down*2}Enter the{red}:{cyan}" 1050 INPUT"First Name{red}";f$ 1060 INPUT"{cyan}Last Name{red}";la$ 1070 INPUT"{cyan}Street Address{red}";sa$ 1080 INPUT"{cyan}City{red}";c$ 1090 INPUT"{cyan}State{red}";s$ 1100 INPUT"{cyan}Zip Code{red}";z$ 1110 INPUT"{cyan}Phone Number{red}";pn$ 1120 INPUT"{cyan}Is This Cocrect{red}";y$ 1130 IFy$<>"y"ANDy$<>"yes"THENPRINT"{cyan}{clear}":GOTO 1040 1140 n=n+1 1150 f$(n)=f$:la$(n)=la$:sa$(n)=sa$:c$(n)=c$:s$(n)=s$:z$(n)=z$:pn$(n)=pn$ 1160 RETURN 1170 REM****************************** 1180 REM****** delete ******** 1190 REM****** a ******** 1200 REM****** record ******** 1210 REM****************************** 1220 GOSUB530:IFeTHENRETURN 1230 n=n-1 1240 FORk=fTOn 1250 f$(k)=f$(k+1) 1260 la$(k)=la$(k+1) 1270 sa$(k)=sa$(k+1) 1280 c$(k)=c$(k+1) 1290 s$(k)=s$(k+1) 1300 z$(k)=z$(k+1) 1310 pn$(k)=pn$(k+1) 1320 NEXTk 1330 PRINT"{down*2}{red}Record Deleted{cyan}":FORp=1TO1000:NEXTp 1340 RETURN 1350 REM***************************** 1360 REM****** change ****** 1370 REM****** a ****** 1380 REM****** record ****** 1390 REM***************************** 1400 GOSUB530:IFeTHENRETURN 1410 INPUT"{cyan}New First Name{red}";f$ 1420 INPUT"{cyan}New Last Name{red}";la$ 1430 INPUT"{cyan}New Street Address{red}";sa$ 1440 INPUT"{cyan}New City{red}";c$ 1450 INPUT"{cyan}New State{red}";s$ 1460 INPUT"{cyan}New Zip{red}";z$ 1470 INPUT"{cyan}New Phone Number{red}";pn$ 1480 INPUT"{down*2}{cyan}OK{red}";y$ 1490 IFy$<>"y"ANDy$<>"yes"THENPRINT"{cyan}":RETURN 1500 f$(f)=f$ 1510 la$(f)=la$ 1520 sa$(f)=sa$ 1530 c$(f)=c$ 1540 s$(f)=s$ 1550 z$(f)=z$ 1560 pn$(f)=pn$ 1570 PRINT"{156}DONE!{cyan}":FORl=1TO500:NEXTl 1580 RETURN 1590 REM***************************** 1600 REM***** printing ****** 1610 REM***** a ****** 1620 REM***** record ****** 1630 REM***************************** 1640 PRINT"{clear}{down*4}{cyan}1. Screen 1650 PRINT"{down}2. Printer 1660 PRINT"{down}{red}Your Choice 1670 GETg$:IFg$=""THEN1670 1680 g=VAL(g$):ONgGOSUB1990,2270 1690 RETURN 1700 REM***************************** 1710 REM***** searching ****** 1720 REM***** for a ****** 1730 REM***** record ****** 1740 REM***************************** 1750 GOSUB 530 1760 PRINT"{down}{red}PRESS{sh space}ANY{sh space}KEY{sh space}TO{sh space}GO{sh space}ON{cyan}" 1770 GETg$:IFg$=""THEN1770 1780 RETURN 1790 REM***************************** 1800 REM***** writing ****** 1810 REM***** a ****** 1820 REM***** record ****** 1830 REM***************************** 1840 INPUT"{clear}{down}{cyan}Name of {reverse on}{red}Output File{reverse off}{cyan}";n$ 1850 OPEN1,8,2,"@0:"+n$+",s,w" 1860 x$=CHR$(13) 1870 FORj=1TOn 1880 PRINT#1,f$(j);x$;la$(j);x$;sa$(j);x$;c$(j);x$;s$(j);x$;z$(j);x$;pn$(j);x$; 1890 NEXTj 1900 CLOSE1 1910 RETURN 1920 REM**************************** 1930 REM******* end ******* 1940 REM**************************** 1950 PRINT"{clear}{down*4}{black}the address book is finished":GOTO2650 1960 REM***************************** 1970 REM***** print to screen ******* 1980 REM***************************** 1990 INPUT"{down*3}{cyan}Do you want it {reverse on}{red}Sorted{reverse off}{cyan}";y$ 2000 IFy$="y"ORy$="yes"THENb=n:GOSUB2120 2009 x=0 2010 x=x+1:IFx>nTHENx=x-n 2011 GOTO 2020 2015 x=x-1:IFx=0THENx=n 2016 GOTO2020 2020 PRINT"{clear}{down}{right*13}{156}ADDRESS{sh space}BOOK{cyan}":PRINT"{down*5}";f$(x);" ";la$(x) 2030 PRINTsa$(x):PRINTc$(x),s$(x):PRINT,z$(x),pn$(x) 2040 PRINT"{up*7}{red}#{cyan}";x 2050 PRINT"{down*16}{156}PRESS {reverse on}{red}+{reverse off} {cyan}TO{sh space}GO{sh space}FORWARD, {red}{reverse on}-{reverse off} {cyan}TO{sh space}GO{sh space}BACK{cyan}" 2051 PRINT"{156}PRESS {reverse on}{red}*{reverse off} {cyan}TO{sh space}END THIS{sh space}ROUTINE.{cyan}" 2060 GETg$:IFg$="+"ORg$="-"ORg$="*"THEN2070 2065 GOTO 2060 2070 IFg$="+"THEN2010 2075 IFg$="-"THEN2015 2076 IFg$="*"THEN2080 2080 RETURN 2090 REM*************************** 2100 REM****** sorting *********** 2110 REM*************************** 2120 m$=la$(1):im=1 2130 FORi=2TOb 2140 IFla$(i)>=m$THENm$=la$(i):im=i 2150 NEXTi 2160 aa$=la$(b):la$(b)=la$(im):la$(im)=aa$ 2170 ab$=sa$(b):sa$(b)=sa$(im):sa$(im)=ab$ 2180 ac$=f$(b):f$(b)=f$(im):f$(im)=ac$ 2190 ad$=c$(b):c$(b)=c$(im):c$(im)=ad$ 2200 ae$=s$(b):s$(b)=s$(im):s$(im)=ae$ 2210 af$=z$(b):z$(b)=z$(im):z$(im)=af$ 2220 ag$=pn$(b):pn$(b)=pn$(im):pn$(im)=ag$:b=b-1:IFb>1THEN2120 2230 RETURN 2240 REM*************************** 2250 REM**** print to printer ***** 2260 REM*************************** 2270 REM 2280 INPUT"{down*2}{156}Do you want it {red}{reverse on}Sorted{reverse off}{156}";y$ 2290 IFy$="y"ORy$="yes"THENGOSUB2120 2300 OPEN8,4:fd$=CHR$(17) 2310 REM 2320 REM 2330 REM 2340 REM 2350 REM 2360 REM 2370 FORx=1TOn 2380 l$(x)=f$(x)+" "+la$(x) 2390 PRINT#8,"#";x 2400 PRINT#8,fd$;l$(x) 2410 REM 2420 PRINT#8,fd$;sa$(x) 2430 REM 2440 o$(x)=c$(x)+", "+s$(x) 2450 PRINT#8,fd$;o$(x)"{space*2}";z$(x) 2460 REM 2470 REM 2480 REM 2490 PRINT#8,fd$;,,pn$(x) 2495 PRINT#8:PRINT#8:PRINT#8 2500 NEXTx 2510 PRINT#8:PRINT#8:PRINT#8 2520 REM 2530 CLOSE8 2540 RETURN 2560 PRINT"{clear}{down}The Address Book by: Joe Spurlock" 2570 PRINT"{up*2}{space*15}tm 2580 PRINT"{down*3}This program is to be used as an addressbook. It is realitivly"; 2590 PRINT" easy to use and{space*2}it is self explanatory. Just do what the"; 2600 PRINT"computer asks for. At any time you want to stop, just press the"; 2610 PRINT" Run-Stop/Restorekeys at the same time. It's in CAPITALS."; 2615 PRINT"Please, if you are going to use the{space*5}EDIT mode, know the name of "; 2617 PRINT"the file youare going to edit." 2620 PRINT"{down*2}PRESS{sh space}ANY{sh space}KEY{sh space}TO{sh space}CONTINUE" 2630 GET k$:IFk$=""THEN2630 2640 RETURN 2650 END:PRINTCHR$(142):POKE53280,14:POKE53281,6:POKE646,14:OPEN3,4:CMD3:LIST 2651 PRINT#3:CLOSE3:END stop tok64 (bastext 1.0)