The ZX81 doesn’t have the ON GOSUB option. I’ve read that a solution to this is to set up a calculation in a GOSUB line. Is this the BEST way to achieve what ON GOSUB does in other versions of BASIC?
E.G: Instead of
100 ON X GOSUB 500,640,780 etc
Use:
100 590*(X=1)+640*(x=2)+780*(x=3) etc
( Is it also true that the Spectrum doesn’t have ON GOSUB?)
On Gosub?
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: On Gosub?
ON GOTO and ON GOSUB is not included in the BASIC for any of the ZX80, ZX81 or ZX Spectrum computers.
For the ZX81 and ZX Spectrum use a computed GOTO or GOSUB.
For example:
Mark
For the ZX81 and ZX Spectrum use a computed GOTO or GOSUB.
For example:
Code: Select all
10 PRINT “ENTER AGE”
20 INPUT A
30 IF A<=0 OR A>115 THEN GOTO 20
40 LET A=INT A
50 GOSUB A*10+1000
60 GOTO 10
1120 PRINT “A CHILD”
1121 RETURN
1190 PRINT “A TEENAGER, REALLY?”
1191 RETURN
1290 PRINT “A YOUNG ADULT”
1291 RETURN
1490 PRINT “APPROACHING MID-LIFE THEN…”
1491 RETURN
2150 PRINT “HELLO OLD FART”
2151 RETURN
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.