ZX 81 - BASIC Programming

Sinclair ZX Spectrum
Chapter 16.2 - Tape storage

Exercises

1. Make a tape with loads of short programs, start playing it back into the computer, & type

LOAD "NOT THE NAME OF A PROGRAM"

You should easily be able to see the difference on the television between the empty stretches on the tape (with a fairly unstructured black & white pattern) & the programs (with more definite lines). Both patterns are different from what you see when you save. If you turn the volume down while a program is going past, you can see the picture switching to the empty space pattern while the signal goes too quiet to look like program.

2. Make a tape on which the first program, when loaded, prints a menu (a list of the other programs on the tape), asks you to choose a program, & then loads it.

3. Type in the program "CHARACTERS" again, & then type

LET X=7

so that - although it doesn't appear in the program - the computer now contains a variable X with value 7. Now save the program, turn the computer off & on (to make sure there's no cheating), & load the program back again.

Type

PRINT X

& you will get the answer 7. The SAVE statement saved not only the program, but also all the variables - including X.

If you want to keep these variables when you execute the program, you must remember to use GOTO & not RUN (as was mentioned in chapter 9). You can avoid having to remember this by making the program execute itself (using SAVE as a program line).

4. Type in a very long program, & them momentarily disconnect the power supply. This sort of thing sometimes happens spontaneously; it is not a bug, but a glitch. There is nothing you can do about it except cry. It if happens more often than you can bear then there is probably something wrong, but it would be worth saving the incomplete program on tape half-way through.

Sinclair ZX Spectrum

  Previous Page Back Next Page