beautypg.com

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

Page 18

background image

Causes an immediate exit from a loop or SWITCH statement.

a = 0

WHILE (a < 10)

a = a + 1

IF (a > 5) BREAK

REM the while loop exits once a > 5

WEND

REM variable a is now 6

16

Returns the arc-tangent value of the given number.

var = ATAN(0)

REM stores 0 in the var variable

PRINT ATAN(1)

REM prints “0.785398” (PI/4)

ATAN

Used in conjunction with the GETVALUE command, BATT requests a new measurement to be

made of the attached battery and stores the value in the given variable.

GETVALUE BATT, var REM stores a new measurement of the attached

REM battery in the var variable

BATT

BREAK

Used with the SWITCH statement to list potential routes.

a$ = “Hi”

SWITCH a$

CASE “Hello”: PRINT “And Hello to you”

BREAK

CASE “Hi”: PRINT “Hi!” : BREAK REM prints “Hi!”

END SWITCH

CASE

BASIC COMMANDS & FUNCTIONS

Returns the ceiling of the given number.

a = CEIL(1.2) REM stores 2 in the a variable

PRINT CEIL(4.7)

REM prints “5”

CEIL