Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n1 (Volume 3, Issue 1)
Date: January 1982
Pages: 17
This 4K program stores ASCII as codes into an array, getting around the 4K BASIC’s lack of string arrays. It stores and prints names and addresses one at a time. This program runs in a 2K machine; for 1K RAM reduce DIM A.
Type in the program, then RUN. Answer A to the first prompt, then enter the requested information. When you list names, enter A in response to the LS prompt to see the next name. SAVE, then reLOAD. Type GO TO 20, not RUN, to see saved names and addresses.
(I got about 5 names and addresses in with A dimensioned to 250, using a 16K RAM pack.–AZ)
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 RETURN
Syntactic Sum: -24803, 4K
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.