Changes

Jump to: navigation, search

Locomotive BASIC

297 bytes added, 13:46, 19 September 2011
/* ON variable GOTO ln x1, x2, x3, x4, ... */
==== <code>ON variable GOTO ln x1, x2, x3, x4, ...</code> ====
: In case of passing more choices '''ON variable GOTO ln x1, x2, x3, x4, ... ''' points to a table with the jumping target.: '''Example:'''
<pre>
10 PRINT "1. LOAD - 2. SAVE - 3. EXIT"
20 INPUT choice
30 ON choice GOTO 1000, 2000, 3000
40 CLS: GOTO 10
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>OPENIN "datafile"</code> ====
205
edits