Jump anywhere: Difference between revisions

Content added Content deleted
(add task to aarch64 assembly raspberry pi)
(Added Chipmunk Basic, GW-BASIC, True BASIC, Quite BASIC, Minimal BASIC and MSX Basic.)
Line 533: Line 533:
300 GOTO : REM NO LINE NUMBER, JUMPS TO LINE 0</syntaxhighlight>
300 GOTO : REM NO LINE NUMBER, JUMPS TO LINE 0</syntaxhighlight>
<syntaxhighlight lang="applesoftbasic">CONT : REM CONTINUE, JUMP BACK TO WHERE THE PROGRAM STOPPED</syntaxhighlight>
<syntaxhighlight lang="applesoftbasic">CONT : REM CONTINUE, JUMP BACK TO WHERE THE PROGRAM STOPPED</syntaxhighlight>

==={{header|Chipmunk Basic}}===
Chipmunk Basic supports both <code>goto</code> and <code>gosub</code>.
{{works with|Chipmunk Basic|3.6.4}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">100 CLS
110 PRINT "First line."
120 GOSUB sub1
130 PRINT "Fifth line."
140 GOTO Ending
150 sub1:
160 PRINT "Second line."
170 GOSUB sub2
180 PRINT "Fourth line."
190 RETURN
200 Ending:
210 PRINT "We're just about done..."
220 GOTO Finished
230 sub2:
240 PRINT "Third line."
250 RETURN
260 Finished:
270 PRINT "... with goto and gosub, thankfully."
280 END</syntaxhighlight>
{{out}}
<pre>Same as FutureBasic entry.</pre>

==={{header|GW-BASIC}}===
{{works with|BASICA}}
{{works with|Chipmunk Basic}}
{{works with|Minimal BASIC}}
{{works with|MSX BASIC|any}}
{{works with|PC-BASIC|any}}
{{works with|QBasic}}
{{works with|Quite BASIC}}
<syntaxhighlight lang="qbasic">100 PRINT "First line."
110 GOSUB 140
120 PRINT "Fifth line."
130 GOTO 190
140 REM sub1:
150 PRINT "Second line."
160 GOSUB 220
170 PRINT "Fourth line."
180 RETURN
190 REM Ending:
200 PRINT "We're just about done..."
210 GOTO 250
220 REM sub2:
230 PRINT "Third line."
240 RETURN
250 REM Finished:
260 PRINT "... with goto and gosub, thankfully."
270 END</syntaxhighlight>


==={{header|IS-BASIC}}===
==={{header|IS-BASIC}}===
<syntaxhighlight lang="is-basic">10 GOTO 100 ! jump to a specific line
<syntaxhighlight lang="is-basic">10 GOTO 100 ! jump to a specific line
20 RUN 200 ! start the program running from a specific line</syntaxhighlight>
20 RUN 200 ! start the program running from a specific line</syntaxhighlight>

==={{header|Minimal BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.

==={{header|MSX Basic}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.

==={{header|Quite BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.


==={{header|Run BASIC}}===
==={{header|Run BASIC}}===
Line 560: Line 622:
print "done"</syntaxhighlight>
print "done"</syntaxhighlight>


=={{header|BASIC256}}==
==={{header|True BASIC}}===
True BASIC supports both <code>goto</code> and <code>gosub</code>.
<syntaxhighlight lang="qbasic">100 ! Jump anywhere
110 CLEAR
120 PRINT "First line."
130 GOSUB 160
140 PRINT "Fifth line."
150 GOTO 210
160 ! sub1:
170 PRINT "Second line."
180 GOSUB 250
190 PRINT "Fourth line."
200 RETURN
210 ! Ending:
220 PRINT "We're just about done..."
230 GOTO 270
240 ! sub2:
250 PRINT "Third line."
260 RETURN
270 ! Finished:
280 PRINT "... with goto and gosub, thankfully."
290 END</syntaxhighlight>
{{out}}
<pre>Same as FutureBasic entry.</pre>

==={{header|BASIC256}}===
BASIC256 supports both <code>goto</code> and <code>gosub</code>.
BASIC256 supports both <code>goto</code> and <code>gosub</code>.
{{works with|QBasic}}
{{works with|QBasic}}