beautypg.com

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

Page 24

background image

Immediately ends the Basic program. Optional if used as the last statement.

var = 12

IF (var > 10) THEN

var = 5

END

ENDIF

var = 10 REM never reached as program has ended (var still equals 5)

22

END

Declares the end of a multi-line IF-THEN statement. Not required on single-line if statements.

var = 16

IF (var >= 21) THEN

PRINT “Adult”

ELSEIF (var >= 13) THEN

PRINT “Teen” REM prints “Teen”

ELSE

PRINT “Child”

ENDIF

ENDIF

Declares the end of a subroutine (begun with the SUB statement).

volume = calc_volume(3, 4, 5) REM volume contains 60

SUB calc_volume(h, w, d)

vol = h * w * d

RETURN vol

END SUB

END SUB

Returns true if the given filenumber has reached the end of the file, false if there is still data

available to be read from the current position.

OPEN “SiteID.csv” FOR READING AS #1

WHILE (NOT EOF(#1))

LINE INPUT #1, var$

PRINT var$ REM prints the contents of SiteID.csv one line at a time

WEND

CLOSE #1

EOF (filenumber)

BASIC COMMANDS & FUNCTIONS