Xylem System 5000 BASIC Manual User Manual

Page 31

Advertising
background image

29

Basic Commands and Functions

Jumps to the specified label or line number within the program. Unlike GOSUB, GOTO statements

never return back to the point of the GOTO and thus have no RETURN statement. Subroutines,

defined with the SUB command, cannot be exited with the GOTO statement.

REM Only prints “Volume: 60” as the GOSUB statement is never reached

h = 3

w = 4

d = 5

GOTO 100

GOSUB ComputeArea

PRINT “Area: “, area REM prints “Area: 12”

END

LABEL ComputeArea

area = h * w

RETURN

100

volume = h * w * d

PRINT “Volume: “, volume REM prints “Volume: 60”

GOTO

Returns the temperature, in degrees Celsius, of the given number (expecting a 0-5V analog

voltage reading) based on the math equation for the WaterLog model H-377 temperature probe.

var = H377C(3.25) REM stores 23.1499

H377C (number)

Returns the temperature, in degrees Fahrenheit, of the given number (expecting a 0-5V analog

voltage reading) based on the math equation for the WaterLog model H-377 temperature probe.

var = H377F(3.25) REM stores 73.6698

H377F (number)

Returns the ascii-hexadecimal representation of the given number as a string.

var = 32

hex_var$ = HEX$(var)

REM stores “20”

HEX$ (number)

A parameter to the DATETIME function returning a two-digit number representation of the current

hour, formatted as HH.

var = DATETIME(HOURS) REM stores 5, inferring the 5th hour

HOURS

Advertising