This is a DATA/READ/RESTORE program that appeared in the February ’87 issue of ZX Computing that was written by David Nowotnik in 1983. I have modified it slightly to make it shorter and a little easier to use. It will let you make DATA statements and READ them like other computers do. Therefore, you will be able to adapt those programs for “bigger” computers on the TS1000.
The first thing you got to do is make a 1 REM statement with at least 107 characters in it. Then enter POKE 16510,0 to change line 1 to 0. Then enter the program from listing 1 and enter the code from listing 2. When you are done, enter the program from listing 3 and SAVE it to tape; that is your master copy.
Using the program is very simple. When a RESTORE instruction is required, replace it by a RAND USR REST. DATA statements are stored in REM lines immediately followed by the gray square on the A key. For strings you don’t need to put quotes before and after the text. You must make sure though that the computer READs it as a string. This is done by using the form of:LET (string variable)=Z$ ( TO USR READ). This would be the equivalent of:READ (string variable). The way to READ numbers is:LET (variable)= VAL Z$ ( TO USR READ). If you run out of DATA in your program, error O/ will occur.
Beware of strings that contain commas in your DATA statements. Suppose that you want to store the sentence “THE TS1000 IS A COMPUTER, THEREFORE IT COMPUTES”. Since there is a comma, the computer will think there are two strings and will READ them as:
THE TS1000 IS A COMPUTER
THEREFORE IT COMPUTES
Also beware that there are as many characters in the DIM Z$ statement as there are in the longest DATA string. You can also use variables other then Z$ as long as it is the first defined variable in the program. If you have non-DATA REM lines that start with a gray square, just put a space between the REM and the square and the computer won’t read it as a DATA line.
This program will let you COPY the number of lines you wish to be copied:
1 REM 12345
10 POKE 16510,0
20 POKE 16514,22
30 POKE 16515,NUMBER OF LINES
40 POKE 16516,195
50 POKE 16517,107
60 POKE 16518,8
RUN and delete lines 10-60. Use RAND USR 16514 to use… This routine is fully relocatable.
This program will let you COPY a specific line from the screen:
1 REM ...19 spaces...
10 INPUT L Line to be copied (1-24): 1=top line
20 LET L=(L-1)*33
30 POKE 16519,L-256*INT (L/256)
40 POKE 16520,INT (L/256)
50 RAND USR 16514
100 FOR F=16514 TO 16532
110 INPUT A
120 POKE F,A
130 NEXT F
Enter RUN 100 and enter the following values:
42:12:64:35:1:0:0:9:1:32:0:17:60:64:237:176:195:83:8
Delete lines 100-130… This routine is fully relocatable.

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