Jump anywhere: Difference between revisions

Jump anywhere en QBasic
m (→‎{{header|Phix}}: not p2js)
(Jump anywhere en QBasic)
Line 2,274:
</lang>
It goes the extra mile and adds a <code>comefrom</code> keyword. This should be used only if you are evil and proud of it. It is reported to have caused maintenance programmers to have so strongly believed themselves insane that it became so. They are now under strong medication in padded cells. Basically whenever the code passes a label it jumps to the comefrom point. For best results I advise writing the comefrom code as far as possible from the label and using no comments near the label.
 
=={{header|QBasic}}==
QBasic supports both <code>goto</code> and <code>gosub</code>.
{{works with|QBasic|1.1}}
{{works with|BASIC256}}
{{works with|Yabasic}}
<lang qbasic>
PRINT "First line."
GOSUB sub1
PRINT "Fifth line."
GOTO Ending
 
sub1:
PRINT "Second line."
GOSUB sub2
PRINT "Fourth line."
RETURN
 
Ending:
PRINT "We're just about done..."
GOTO Finished
 
sub2:
PRINT "Third line."
RETURN
 
Finished:
PRINT "... with goto and gosub, thankfully."
END</lang>
{{out}}
<pre>Igual que la entrada de FutureBasic.</pre>
 
=={{header|Quackery}}==
2,156

edits