8 CLEAR 1000,1200 9 DEFFIL 30,600 10 GOSUB 5000 11 CLS 15 FL=0 20 PRINT"===PHONE BOOK===" 30 PRINT"1-SEARCH" 40 PRINT"2-ADD/EDIT A NAME" 50 PRINT"CHOICE: "; 60 A=VAL(INKEY$) 70 ON A GOTO 420,100 80 GOTO 60 100 CLS 110 GET%0,I$:NUM=VAL(I$) 120 PRINT"ADD/EDIT A NAME" 130 INPUT"NAME: ";N$ 131 IF N$=""THEN 10 140 FOR X=1 TO NUM 150 GET% X,A$ 160 IF N$=LEFT$(A$,LEN(N$)) THEN 180 170 NEXTX:GOTO320 180 CLS:PRINT"NAME EXISTS" 185 P=X 190 FORX=1 TO LEN(A$) 200 IF MID$(A$,X,1)="-" THEN220 210 NEXTX:STOP 220 REM 230 PRINT"*** EDIT ***" 240 N$=LEFT$(A$,X-1) 245 PRINT "OLD: "N$ 250 INPUT"NAME";X$:IFX$<>""THEN N$=X$ 260 P$=RIGHT$(A$,LEN(A$)-X) 265 PRINT"OLD #: ";P$ 270 INPUT"PHONE:";X$:IF X$<>""THEN P$=X$ 280 CLS:PRINTN$:PRINTP$ 290 INPUT"CORRECT";X$ 300 IF X$<>"Y" THEN 220 310 A$=N$+"-"+P$:PUT% P,A$:GOTO10 320 INPUT"PHONE: ";P$ 330 CLS 340 PRINTN$:PRINTP$ 350 PRINT"CORRECT "; 355 A$=INKEY$ 360 IF A$="N" THEN100 365 IF A$="Y" THEN370 366 GOTO 355 370 NUM=NUM+1 375 I$=STR$(NUM)+"WS" 380 PUT% 0,I$ 390 A$=N$+"-"+P$ 400 PUT% NUM,A$ 410 GOTO10 420 GET% 0,I$:NUM=VAL(I$) 430 CLS 440 PRINT"ENTER NAME" 450 PRINT"TO FIND:" 460 INPUT N$ 470 IF N$="" THEN FL=1:N$="*" 480 FOR X=1 TO NUM 490 GET% X,A$ 500 IF FL=0THEN 520 510 PRINT A$ 520 IF LEFT$(A$,LEN(N$))=N$ THENGOSUB 600 530 NEXT X 540 IF FL=0 THEN 570 550 IF INKEY$="" THEN 550 560 GOTO10 570 CLS:PRINT:PRINT"PRESS ANY KEY" 580 GOSUB 680:GOTO10 590 GOTO10 600 FOR Y=1 TO LEN(A$) 610 IF MID$(A$,Y,1)="-" THEN 640 620 NEXTY 630 STOP 640 CLS 650 N1$=LEFT$(A$,Y-1):PRINTN1$ 660 P$=RIGHT$(A$,LEN(A$)-Y):PRINTP$ 670 PRINT:PRINT"P)RINT N)EXT"; 680 X$=INKEY$:IF X$="" THEN 680 685 IF X$="P" THEN LPRINT N1$:LPRINT P$ 690 RETURN 5000 REM**** 5010 GET% 0,A$ 5020 IF MID$(A$,3,2)<>"WS" THEN 5200 5030 RETURN 5200 A$="00WS" 5210 PUT%0,A$ 5220 RETURN