Apologies in advanced if this seems like a straight-forward question, I've looked in the ZX81 Basic manual and can't find the answer...
Is it possible to save a Basic program so when it's loaded back in it runs immediately, rather like in Spectrum Basic by using SAVE "NAME" LINE 10 ?
Thanks!
Load and immediately run a ZX81 Basic program
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Load and immediately run a ZX81 Basic program
See Chapter 16 - Tape storageZX81 BASIC Manual wrote:LOAD & SAVE can also be used in programs. With SAVE, the program will save itself in such a state then when loaded it will immediately carry on executing from the line after the SAVE statement.
So to jump to a line number, use a GO TO after the SAVE:
Code: Select all
9050 SAVE “myprog”
9060 GO TO 10
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Load and immediately run a ZX81 Basic program
Basically you save the program from within itself while it is running. Since it was saved in a running state it continues running when loaded back in.
10 PRINT "HELLO"
20 GOTO 10
100 SAVE"RUNNING"
110 GOTO 10
RUN 100
10 PRINT "HELLO"
20 GOTO 10
100 SAVE"RUNNING"
110 GOTO 10
RUN 100
Re: Load and immediately run a ZX81 Basic program
Perfect just what I was looking for thank you both.
Rechecked the manual too and found the page you're referring to in Chapter 16... I must have missed that page, thanks again!
Rechecked the manual too and found the page you're referring to in Chapter 16... I must have missed that page, thanks again!