3 ms·
These BASIC goto statements are pretty tame. Some basic interpreters did not require the line number in the statement to be constant. You could do things lik
by hyperman1 4y ago
These BASIC goto statements are pretty tame. Some basic interpreters did not require the line number in the statement to be constant. You could do things like a switch:
switch n{case 1: case 2: case 3:}
would become e.g.
goto n*100+1000
with lines 1100,1200,1300 handling the cases.
And then there was the hidden advanced troubleshooting console:
input N: GOTO N
- dan-robertson 4y agoThis is how you do a SWITCH statement in Microsoft’s command language (for .bat files) I think.
- 4cao 4y agoIt does come in handy in some scenarios: choice /c abc goto choice%errorlevel% :choice1 :choice2 :choice3 Or, for command-line parameters: set ops=a b c set op=%1 for %%p in (%ops%) do if "%op%"=="%%p" goto %op% goto usage