Xylem System 5000 BASIC Manual User Manual
Page 33

31
Basic Commands and Functions
Returns the integer part of the given number.
var = INT(26.245) REM stores 26
INT (number)
Returns the position, starting at the position given by the third optional parameter (default is 1),
of the first occurrence of the second given string within the first given string beginning at the left.
Returns the position, starting at the position given by the third optional parameter (default is 1), of
the first occurrence of the second given string within the first given string beginning at the left.
var = INSTR(“Analog 2: 3.5, Digital 4: 1”, “Digital”) REM stores 16
var = INSTR(“Analog 1: 1.25, Analog 2: 2.5”, “Analog”, 2) REM stores 17
INSTR (string, string, number)
Used in conjunction with the SETNETWORK command, IP will find or set the Ethernet IP Address to
use for the network. Available parameters are AUTO or MANUAL. AUTO will automatically find an
IP Address (DHCP); MANUAL sets the given parameter as the IP Address.
SETNETWORK IP AUTO
SETNETWORK IP MANUAL, “192.168.0.82”
IP
A parameter to the DATETIME function returning the current calendar julian day as a number,
formatted as DDD.
var = DATETIME(JDAY) REM stores 57, inferring February 26th
JDAY
Identifies a specific location according to the given name. Commands such as GOTO and GOSUB
can refer to and send execution to named LABELs. Line numbers are simply a special case of
LABELs and are also supported.
h = 3
w = 4
d = 5
GOTO 100
LABEL ComputeArea
area = h * w
PRINT “Area: “, area REM prints “Area: 12”
RETURN
100
volume = h * w * d
PRINT “Volume: “, volume REM prints “Volume: 60”
GOSUB ComputeArea
END
LABEL