8-Bit Software Online Conversion
:2.W.PBOOK - Listing
10REM*Phonebook*
20REM*Andy Weston*
30REM*August 1993*
40REM*************
50 MODE7
60GOSUB650
70PROCin
80PROCmen
90IF Y%=5 THEN PROCent:GOTO80
100IFY%=6 THEN PROCfind:GOTO80
110IFY%=7 THEN PROCsave:GOTO80
120IFY%=8 THEN PROCload:GOTO80
130IF Y%=9 THEN PROClist:GOTO80
140END
150DEF PROCent
160CLS
170GOSUB650
180*FX15,0
190REPEAT
200INPUTLINE"NAME:"B$
210A$(A%,0)=B$
220INPUT"NUMBER",C$
230A$(A%,1)=C$
240A%=A%+1
250PRINT'" <F> to finish, <SPACE> cont
inue"
260G=GET
270IFG=32 THEN 290
280IFG=70THEN ENDPROC
290UNTILFALSE
300ENDPROC
310DEF PROCfind
320CLS:GOSUB650
330*FX15,0
340REPEAT
350INPUT"NAME"F$
360FOR R%=0TO200
370IFA$(R%,0)=F$ THEN PRINT A$(R%,1):G
OTO400
380NEXTR%
390PRINT"NOT FOUND"
400PRINT'" <F> to finish, <SPACE> cont
inue"
410G=GET:IFG=32THENGOTO430
420IFG=70THEN ENDPROC
430UNTILFALSE
440ENDPROC
450DEF PROCin
460A%=0
470VDU23;8202;0;0;0;
480DIMA$(200,1)
490DIMO$(5)
500Y%=5
510RESTORE 640
520FORRO%=1TO 5:READ O$(RO%):NEXT RO%
530ENDPROC
540DEF PROCmen
550CLS
560REPEAT
570TY%=5
580FORPO%=1TO5:PRINTTAB(2,TY%);CHR$135
;;O$(PO%):TY%=TY%+1:NEXTPO%
590IFINKEY(-58)AND Y%>5THEN Y%=Y%-1:PR
INTTAB(0,Y%+1);STRING$(20," ")
600IFINKEY(-42)AND Y%<9THEN Y%=Y%+1:PR
INTTAB(0,Y%-1);STRING$(20," ")
610PRINTTAB(0,Y%);CHR$130;CHR$157
620IFINKEY(-74)THENENDPROC
630UNTILFALSE
640 DATA Make entry,Find number,Save n
umbers,Load numbers,List numbers
650VDU26
660PRINTTAB(0,0);CHR$129;CHR$157;CHR$1
31;CHR$141;"Phonebook by A.J.W.":PRINTTA
B(0);CHR$129;CHR$157;CHR$131;CHR$141;"Ph
onebook by A.J.W."
670VDU28,0,12,39,2
680RETURN
690 DEF PROCsave
700GOSUB650
710CLS
720*FX15,0
730INPUT" Filename",F$
740 X=OPENOUT F$
750FOR SF%=0 TO A%
760PRINT#X,A$(SF%,0)
770PRINT#X,A$(SF%,1)
780NEXTSF%
790CLOSE#X
800ENDPROC
810 DEF PROCload
820GOSUB650:CLS:*FX15,0
830INPUT" Filename",F$
840INPUT" Entries on file",E%
850X=OPENIN F$
860FOR in=0 TO (E%-1)
870INPUT #X,A$(in,0)
880INPUT #X,A$(in,1)
890NEXT in
900ENDPROC
910DEF PROClist
920GOSUB650
930CLS
940*FX15,0
950VDU14
960FOR G=0 TO 200
970IF A$(G,0)=""THEN GOTO 1000
980PRINTA$(G,0),A$(G,1)
990NEXT G
1000VDU15
1010G$=GET$
1020ENDPROC