READ DATA

Author(s): Walter Bader; Joan Kealy
Publication: LISTing Newsletter
Date: July 1985
Pages: 19

READ DATA

FOR ZX 81 – TIMEX 1000

By: Walter Bader

PUT ALL DATA INTO ONE STRING (D$)

Separate data by commas (,) put a comma at end followed by STOP (SHIFTED A) (no commas may be in the DATA) (see note)

When you return to your program from the Read Subroutine, the current data element will be in R$.

1. INITIALIZE: (must be processed before any READ statements)

DATA LINES (LET D$ =" data, data, data,"
(LET D$ = D$+" data, data, etc., STOP "

LET READ = (gosub line #)
LET RP = 0

2. READ STATEMENTS

GOSUB READ
(LET variable = VAL R$
(LET string variable = R$

3. RESTORE STATEMENTS

LET RP = 0

4. SUBROUTINE (AT LINE # READ)

LET DP = RP + 1
IF D$(DP)= "STOP" THEN GOTO READ + 6
LET RP = RP + 1
IF D$ (RP) = "," THEN GOTO READ + 2
LET R$ = D$ (DP TO RP - 1)
RETURN
PRINT "OUT OF DATA"; END

5. VARIABLES USED

D$ – DATA STRING
R$ – DATA RETURN
DP – DATA POSITION
RP – READ POSITION
READ – GOSUB LINE #

NOTE: IF A COMMA MUST BE USED, SUBSTITUTE A TOKEN OR GRAPHIC FOR ALL COMMAS (SUGGEST LLIST)


Drawing program screen - SHADES palette and a face, with DRAW MENU (SHADE, BRUSH, HORZ, LINE, CIRC, UNDO, FIL, BCLR, BORD, TEXT, I&O, CLS)
Drawing program screen – SHADES palette and a face, with DRAW MENU (SHADE, BRUSH, HORZ, LINE, CIRC, UNDO, FIL, BCLR, BORD, TEXT, I&O, CLS)

TS PUZZLE

Here is a word square puzzle that was generated by a program contributed by Joan Kealy. Look for as many words having to do with TIMEX/Sinclair computing, as you can find. Send your answers back to me:

Abilene TSUG
c/o Chris Nystrom
609 E.N. 18th
Abilene, Texas 79601

and I will a list the names and the number of words each person found.

TS Puzzle word square (20 x 20 letters)
TS Puzzle word square (20 x 20 letters)

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.