An address book for the ZX80 (4K ROM), which has no string arrays. The program stores each entry as character codes in the array A, with markers for the end of each line and each entry. Enter A to add a name, street, city and state, ZIP and phone number; press NEWLINE to list the entries one at a time.
SAVE the program to keep the entries, and after LOADing start with GO TO 20, not RUN, which would clear the array. It runs in 2K; for 1K, make A smaller. An editor’s note reports about five entries fitting with A dimensioned to 250.
Published in Syntax January 1982 (Address and Phone Book).
Source Code
5 DIM A(250)
6 LET N=0
10 CLS
20 PRINT "ENTER A TO ADD. DEFAULT IS LIST."
30 INPUT A$
40 IF A$="A" THEN GO TO 300
50 CLS
60 LET X=0
70 IF A(X)=222 THEN GO TO 130
80 IF A(X)=130 THEN GO TO 170
90 PRINT CHR$(A(X));
100 LET X=X+1
110 IF X=N-1 THEN STOP
120 GO TO 70
130 PRINT
140 PRINT
150 LET X=X+1
160 GO TO 70
170 INPUT A
180 LET X=X+1
190 CLS
200 GO TO 70
300 CLS
310 PRINT "NAME ?"
320 GO SUB 500
330 PRINT "STREET ?"
340 GO SUB 500
350 PRINT "CITY, STATE ?"
360 GO SUB 500
370 PRINT "ZIP ?"
380 GO SUB 500
390 PRINT "PHONE ?"
400 GO SUB 500
410 LET A(N)=130
420 LET N=N+1
430 GO TO 10
500 INPUT N$
510 LET A=CODE(N$)
520 IF A=1 THEN GO TO 570
530 LET A(N)=A
540 LET N=N+1
550 LET N$=TL$(N$)
560 GO TO 510
570 LET A(N)=222
580 LET N=N+1
590 RETURNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

