ON int-exp GOTO line-nol,line-no2,....line-noN

Int-exp is evaluated and if it is equal to 1, the program will jump to the line-nol. If int-exp evaluates to N, BASIC will jump to line-noN. If int-exp is equal to 0 or greater than the number of line numbers given, execution will continue with the next statement.

Program Example.

00100 INPUT "Please enter a number from 1 to 3",B
00110 ON B GOTO 1000,2000,3000
00130 GOTO 4000
01000 PRINT "microbee"
02000 PRINT "Computers"
03000 PRINT "Are Fun to Use"
04000 END

Try it

See also GOTO, ON..GOSUB.