Changes

Jump to: navigation, search

Locomotive BASIC

611 bytes added, 13:51, 19 September 2011
/* Command list */
1000 PRINT "1. LOAD":END
2000 PRINT "2. SAVE":END
3000 END
</pre>
:In case that the variable ''choice'' won't fullfil the condition (in a range between line 0 and 65535) the next instruction will be executed (here: Line 40). If "choice" is smaller than 0 an error will occur.
 
==== <code>ON variable GOSUB ln x1, x2, x3, x4, ...</code> ====
 
: In case of passing more choices targeting to SUBROUTINES '''ON variable GOSUB ln x1, x2, x3, x4, ...''' points to a jumping table.
: '''Example:'''
<pre>
10 PRINT "1. LOAD - 2. SAVE - 3. EXIT"
20 INPUT choice
30 ON choice GOSUB 1000, 2000, 3000
40 CLS: GOTO 10
1000 PRINT "1. LOAD":RETURN
2000 PRINT "2. SAVE":RETURN
3000 END
</pre>
205
edits