On number gosublabels, On number goto – Xylem STORM 3 Basic Programming manual User Manual
Page 29

27
Commands and Functions
Negates the expression immediately following. The ! operator may alternatively be used.
OPEN “SiteID.csv” FOR READING AS #1
WHILE (NOT EOF(#1))
LINE INPUT #1, var$ REM reads each line of the log file
WEND
CLOSE #1
NOT
Branches to one of a list of labels(with an expected RETURN) based on the given number. For
example, if the given number is 1, the first GOSUB listed is used, if the number is 2, the second
GOSUB, etc.
REM iterate through each label
height = 3
width = 4
depth = 5
FOR a = 1 TO 3
ON a GOSUB calc_area,calc_volume,200
NEXT a
LABEL calc_area
area = height * width
RETURN
LABEL calc_volume
volume = area * depth
RETURN
200
END
ON number GOSUBlabels
Jumps to one of a list of labels(without an expected RETURN) based on the given number/
argument. For example, if the given number is 1, the first GOTO listed is used, if the number is 2,
the second GOTO, etc. Unlike GOSUB, GOTO statements never return back to the point of the
GOTO.
GETVALUE SYSTEMP, temp
IF (temp > 40) THEN
var = 1
ELSEIF (temp > 30) THEN
var = 2
ELSE
var = 3
ON number GOTO