3 MODE7
4 *KEY0 RUN|M
5 *KEY9 PROCEXAMIN|M
6 ON ERROR GOTO 9000
10 CLS:PRINTTAB(11,9)"TELEPHONE NUMBE
RS."''"DO YOU WISH TO"''"A----FILE A NUM
BER."'"B----FIND A NUMBER."'"C----ALTER
A NUMBER."'"D----REMOVE A NAME OR NUMBER
FROM FILE."
20 G=GET
30 IF G=65 THEN CLS:PRINTTAB(13,12)"P
LEASE WAIT.":PROCMEASURE ELSE 70
40 DIM ARY$(Z%+100):REM Z% IS FROM PR
OCMEASURE
50 PROCARY
60 PROCFILE
70 IF G=66 THEN PROCRET
80 IF G=67 THEN PROCALTER
90 IF G=68 THEN PROCREMOVE
95 IF G<>65 AND G<>66 AND G<>67 AND G
<>68 THEN PRINT'"YOU PRESSED ";CHR$G:PRO
CCONTINUE
98 END
99:
100 DEF PROCFILE
110 CLS:X%=Z%+1:D%=0:REM X%= ONE MORE
THAN END OF FILE SO FAR.
120 REPEAT
130 INPUT"NAME AND ADDRESS? "A$
140 INPUT"TELEPHONE NUMBER? "B$
150 PROCDATAREM:REM Check to see if th
ere is room in file where data has been
removed.
160 IF D%=1 THEN ARY$(X%)=A$:X%=X%+1:R
EM D% Is from PROCDATAREM
165 IF D%=1 THEN ARY$(X%)=B$:X%=X%+1
170 IF X%>Z%+90 VDU7:PRINT"RUNNING OUT
OF SPACE IN ARRAY.SAVE ASAP"
175 INPUT"#########CONTINUE?#########
"C$
176 IF LEN(C$)>3 THEN VDU7:PRINT"CHECK
"
180 UNTIL LEFT$(C$,1)="N"
190 PRINT:INPUT"DO YOU WISH TO SAVE TO
DISC? "S$
200 IF LEFT$(S$,1)="Y" THEN PROCSAVE
210 PRINT:PRINTTAB(16)"THE END":PRINT:
PROCCONTINUE
220 ENDPROC
250:
300 DEF PROCDATAREM
310 IF D%=1 ENDPROC
315 D%=1:M%=0
320 PRINT"PLEASE WAIT"
325 VDU11
330 REPEAT
340 IF ARY$(M%)="DATA REMOVED"AND ARY$
(M%+1)="DATA REMOVED"THEN ARY$(M%)=A$:AR
Y$(M%+1)=B$:D%=0:M%=Z%:GOTO 360
350 M%=M%+1
360 UNTIL M%=Z%
380 ENDPROC
400:
500 DEF PROCSAVE
505 CLOSE#0
510 B%=0
520 A%=OPENOUT"PHONE"
525 REPEAT
530 PRINT#A%,ARY$(B%)
540 B%=B%+1
550 UNTIL B%=X%:REM X% IS FROM PROCFIL
E
560 CLOSE#A%
570 ENDPROC
600:
700 DEF PROCMEASURE
705 CLOSE#0
710 Z%=0
720 G%=OPENIN"PHONE"
730 REPEAT
740 INPUT#G%,G$
750 Z%=Z%+1
760 UNTIL EOF#(G%)
765 Z%=Z%-1
770 CLOSE#(G%)
780 ENDPROC
800:
1000 DEF PROCARY
1030 CLOSE#0
1050 Y%=0
1100 H%=OPENIN"PHONE"
1200 REPEAT
1300 INPUT#H%,ARY$(Y%)
1400 Y%=Y%+1
1500 UNTIL EOF#(H%)
1600 CLOSE#(H%)
1700 ENDPROC
1750:
1800 DEF PROCEXAMIN
1830 CLOSE#0
1850 CLS
1900 VDU14:REM Page mode.
1950 PROCWINDOW:REM Set up a text windo
w.
2000 G%=OPENIN"PHONE"
2100 REPEAT
2200 INPUT#G%,G$
2300 PRINT G$
2400 UNTIL EOF#(G%)
2500 CLOSE#(G%)
2600 VDU15:REM Out of page mode.
2650 VDU26:REM Remove text window.
2700 ENDPROC
2750:
3000 DEF PROCRET
3030 CLOSE#0
3050 CLS:N%=0:GO%=0
3100 INPUTTAB(0,10)"WHAT NAME DO YOU WI
SH TO FIND NUMBER FOR"NUM$
3150 L%=LEN(NUM$)
3200 CLS:PRINTTAB(13,10)"PLEASE WAIT."
3300 VDU14:REM PAGE MODE ON
3400 R%=OPENIN"PHONE"
3500 REPEAT
3600 INPUT#R%,A$,B$
3700 IF LEFT$(A$,L%)=NUM$ AND GO%=0 THE
N CLS:GO%=1:PROCWINDOW:REM RUB OUT "PLEA
SE WAIT" LINE 3200
3750 IF LEFT$(A$,L%)=NUM$ THEN PRINT A$
:PRINT"TELEPHONE NUMBER "B$:PRINT:N%=1
3800 UNTIL EOF#(R%)
3850 CLOSE#(R%)
3860 IF N%<>1 THEN CLS:PRINTTAB(0,10)NU
M$:PRINT'"THERE IS NO ONE OF THAT NAME O
N FILE."
3870 PRINT"THAT IS THE END OF THE FILE.
"
3880 PROCCONTINUE
3890 PROCSEEFILE
3900 VDU15:REM PAGE MODE OFF
3950 VDU26:REM Remove text window.
4000 ENDPROC
4500:
5000 DEF PROCALTER
5100 CLS:X%=0:M%=0:RUB%=0:INPUTTAB(0,10
)"WHAT IS THE EXISTING PHONE NUMBER ON T
HEFILE TO BE CHANGED "PH$
5150 CLS:PRINTTAB(13,10)"PLEASE WAIT"
5200 PROCMEASURE
5250 DIM ARY$(Z%):REM Z% FROM PROCMEASU
RE
5300 PROCARY
5350 VDU14:REM PAGE MODE.
5400 FOR J%=0 TO Z%
5430 IF RIGHT$(ARY$(J%),4)=RIGHT$(PH$,4
) THEN IF RUB%=0 PRINTTAB(13,10)"
":RUB%=1:REM RUB OUT PLEASE WAIT IN
LINE 5150
5450 IF RIGHT$(ARY$(J%),4)=RIGHT$(PH$,4
) THEN PRINT'ARY$(J%-1):PRINT"TELEPHONE
NUMBER "ARY$(J%):M%=1
5500 NEXT J%
5520 IF M%<>1 THEN CLS:PRINTTAB(0,10)PH
$:PRINT'"THERE IS NO ONE ON FILE WITH TH
AT"'"TELEPHONE NUMBER.":VDU15:PROCSEEFIL
E:PROCCONTINUE:ENDPROC
5550 INPUT'"IS THIS THE INFORMATION"'"T
HAT YOU WISH TO CHANGE "AA$
5600 VDU15:REM OUT OF PAGE MODE.
5650 IF LEFT$(AA$,1)="Y"THEN INPUT'"WHA
T IS THE NEW TELEPHONE NUMBER. "TEL$ ELS
E PRINT'"SORRY,THAT IS ALL THERE IS ON F
ILE WITH"'"THAT NUMBER.":PROCSEEFILE:PRO
CCONTINUE:ENDPROC
5700 PRINTTAB(13)"PLEASE WAIT"
5800 FOR J%=0 TO Z%
5850 IF RIGHT$(ARY$(J%),4)=RIGHT$(PH$,4
)THEN ARY$(J%)=TEL$
5900 NEXT J%
5950 X%=Z%+1:PROCSAVE:REM X% IS USED IN
PROCSAVE.
5960 PRINT:PRINTTAB(14)"THANK YOU":PROC
CONTINUE
5970 ENDPROC
5980:
6000 DEF PROCREMOVE
6030 CLS:X%=0:M%=0:RUB%=0:INPUTTAB(0,10
)"WHAT IS THE TELEPHONE NUMBER ON THE FI
LETO BE REMOVED "N$
6040 CLS:PRINTTAB(13,10)"PLEASE WAIT"
6050 PROCMEASURE
6060 DIM ARY$(Z%):REM Z% IS FROM PROCME
ASURE
6080 PROCARY
7000 FOR K%=0 TO Z%
7010 IF RIGHT$(ARY$(K%),4)=RIGHT$(N$,4)
THEN IF RUB%=0 PRINTTAB(13,10)"
":RUB%=1:REM RUB OUT PLEASE WAIT IN L
INE 6040
7020 IF RIGHT$(ARY$(K%),4)=RIGHT$(N$,4)
THEN PRINT ARY$(K%-1):PRINT"TELEPHONE N
UMBER "ARY$(K%):M%=1
7040 NEXT K%
7060 IF M%<>1 THEN CLS:PRINTTAB(0,10)N$
:PRINT'"THERE IS NO ONE ON FILE WITH THA
T"'"TELEPHONE NUMBER.":PROCSEEFILE:PROCC
ONTINUE:ENDPROC
7080 INPUT'"IS THIS THE INFORMATION"'"T
HAT YOU WISH TO REMOVE "R$
7100 IF LEFT$(R$,1)="Y"THEN PRINT'"IF Y
OU ARE SURE THAT YOU WANT TO REMOVE THIS
FILE THEN PRESS THE SPACE BAR."ELSE PRI
NT'"THAT IS ALL THERE IS ON FILE WITH TH
AT TELEPHONE NUMBER.":PROCSEEFILE:PROCC
ONTINUE:ENDPROC
7200 IF INKEY(3000)=32 THEN PROCGO ELSE
PROCCONTINUE
7230 ENDPROC
7250:
7500 DEF PROCGO
7520 FOR K%=0 TO Z%
7540 IF RIGHT$(ARY$(K%),4)=RIGHT$(N$,4)
THEN ARY$(K%-1)="DATA REMOVED":ARY$(K%)
="DATA REMOVED"
7560 NEXT K%
7570 X%=Z%+1:PROCSAVE:REM X% IS USED IN
PROCSAVE
7580 PROCCONTINUE
7590 ENDPROC
7600:
8000 DEF PROCWINDOW
8050 PRINTTAB(7,23)"PRESS SHIFT TO SCRO
LL TEXT";TAB(0,3)
8100 VDU28,0,21,39,3
8200 ENDPROC
8250:
8300 DEF PROCSEEFILE
8320 PRINT'"TO EXAMINE THE FILE PRESS T
HE RED KEY f9"
8340 ENDPROC
8400:
8500 DEF PROCCONTINUE
8520 PRINT'"TO CONTINUE PRESS THE FIRST
RED KEY f0."
8530 ENDPROC
8550:
9000 CLOSE#0:REPORT:PRINT" At line ";ER
L:PROCCONTINUE:END