
Purpose
Κ
To call one of the specified subroutines depending on the
value of the expression.
Syntax
Κ
ON N% GOSUB SubLabel| SubName {,SubLabel|
SubName}
Example
Κ
D% = DAY_OF_WEEK
ON D% GOSUB MON, THE, WED, THR, FRI, SAT, SUN
WHILE INKEY$=""
WEND
END
MON:
PRINT "MONDAY"
RETURN
THE:
PRINT "TUESDAY"
RETURN
WED:
PRINT "WEDNESDAY"
RETURN
THR:
PRINT "THURSDAY"
RETURN
FRI:
PRINT "FRIDAY"
RETURN
SAT:
PRINT "SATURDAY"
RETURN
SUN:
PRINT "SUNDAY"
RETURN
Description
Κ
N%
is a numeric expression that is rounded to an integer. The
value of N% determines which subroutine is to be called. If
the value of N% is 0 or greater than the number of routines
listed, the interpreter will continue with the next executable
statement.
SubLabel
is the name of a subroutine.
T P C 7 0 3 0
Programming Manual Ver. 1.00
20/131