But ON GOTO is even more powerful on e.g. Sinclair Basic. If I remember correctly, it lets you use formulas instead of individual variables:Jeff-20 wrote:For me, lack of good branching statements (if, then, else) is covered by the ON GOTO command combo... It's actually very efficient in a way.
ON B/(A-20) GOTO 10,21,23,72,44
I'm not sure, but I believe in one or another dialect, you may even be able to do something like this:
ON A GOTO B,C,D,F (where those are variables)
The ultimate would be if you could use formulas as line number targets:
ON B/(A-20) GOTO C/10,(B+C)*5,INT(SQR(D))
One might question what kind of spaghetti code the program consists of if you need those complicated formulas. I can't recall right now, but does Commodore Basic even accept GOTO A (a variable) ?