09-28-2021, 09:56 PM
(This post was last modified: 09-28-2021, 09:56 PM by maeloterkim.)
(09-28-2021, 07:41 PM)boriel Wrote:(09-27-2021, 01:50 PM)maeloterkim Wrote: Hi
in the original ZX spectrum basic you can do this
goto MyVariable or gosub MyVariable where this variable must be a line number
maybe you can implement this with the compiler
...
this way the behaviour is more like the original ZX spectrum
You don't need all of this. Use ON ... GOTO / ON GOSUB instead.
Code:on myVariable gosub MyRoutine1, MyRoutine2, MyRoutine3
myLoop:
goto myLoop
MyRoutine1:
print "MyRoutine1"
return
MyRoutine2:
print "MyRoutine2"
return
MyRoutine3:
print "MyRoutine3"
return
Try this, and let me know if it works.
Yes it works
But i didnt found this ON .. GOTO OR GOSUB in the documentation ( https://zxbasic.readthedocs.io/en/docs/identifier/ )
maybe there is something or a lot more that we dont know
