Basic commands & functions – Xylem System 5000 BASIC Manual User Manual
Page 36

Returns a smaller section (substring) of a given string. The first parameter is the given string, the
second is the starting point from the left side, and the third optional parameter dictates how many
characters to return. If the third parameter is omitted, all remaining characters are returned.
var$ = MID$(“A2: 12.5, VB: 12.250”, 11)
REM stores VB: “12.250”
myStr$ = “A1: 15, A2: 18, D3: 0”
var$ = MID$(myStr$, 9, 6) REM stores VB: “A2: 18”
34
MID$ (string, number, number)
Returns the remainder of a division between the two given numbers. MOD performs floatingpoint
divisions and remainders. For integer-only divisions/remainders, use the % operator.
a = 102.5
b = 10
PRINT MOD(a, b)
REM prints “2.5”, inferring a (102.5/10) calculation
PRINT a % b REM prints “2”, inferring a (102/10) calculation
Returns the minimum value of the two given numbers.
a = RND() // generates a random number between 0 and 1
b = RND() // generates a random number between 0 and 1
c = MIN(a, b) REM stores the smallest of the two in c
MIN (number, number)
A parameter to the DATETIME function returning a two-digit number representation of the current
day, formatted as MM.
var = DATETIME(MINUTES) REM stores 39, inferring the 39th minute
MINUTES
MOD (number, number)
BASIC COMMANDS & FUNCTIONS
A parameter to the DATETIME function returning a two-digit number representation of the current
month, formatted as MM.
var = DATETIME(MONTH) REM stores 2, inferring February
MONTH
Used in conjunction with the SETNETWORK command, NETMASK sets the given parameter as the
Netmask to use for IP Address on the network. The NETMASK command should be given after the
IP MANUAL entry and before an IP GATEWAY command.
SETNETWORK NETMASK, “192.168.0.1”
NETMASK