Self Running Programs

Author(s): Chris White
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n11 (Volume 3, Issue 11)
Date: November 1982
Pages: 4

Making a self-running program on the ZX81 is very simple. Just insert a SAVE statement at the place you want the computer to continue from. The SAVE statement acts like a CONTinue statement, continuing at the next line with the same variables it left off with. So a self-running program eliminates the need for the user to start the program. It also lets you put executable statements after the SAVE command.

After entering the example, type NEW, LOAD “ZZ” and the screen should display the character set from your keyboard then pause about 2 seconds. This program shows that the ZX/TS saves the screen content, variables and the line the program was saved on.

  10 FOR A=1 TO 255
20 PRINT CHR$ (A);
30 NEXT A
40 PAUSE 100
50 SAVE "ZZ"
60 PAUSE 100
SYNTACTIC SUM: 4942,8K

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