Commands and functions – Xylem STORM 3 Basic Programming manual User Manual
Page 26

24
COMMANDS AND FUNCTIONS
Identifies a specific location by name. Commands such as GOTO and GOSUB can refer to and
send execution to named LABELs. Line numbers are a special case of LABELs and do not require
the LABEL prefix to be named.
h = 3
w = 4
d = 5
GOSUB 100 REM sets volume to 60
GOSUB ComputeArea REM sets area to 12
END
LABEL ComputeArea
area = h * w
RETURN
100
volume = h * w * d
RETURN
LABEL
Returns a string, starting from the left side, containing the given number of characters from the
given string.
var$ = “A1,B2,C3,D4”
ab$ = LEFT$(var$, 5)REM sets ab$ to A1,B2
LEFT$ (string, number)
Returns the length of the given string.
var = LEN(“A1,B2,C3,D4”) REM sets var to 11
LEN (string)
Reads an entire line from an open file
.
OPEN “SiteID.csv” FOR READING AS #1
LINE INPUT #1, b$ REM retrieves the first line and stores it in b$
CLOSE #1
LINE INPUT