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

Page 52

Advertising
background image

50

BASIC COMMANDS & FUNCTIONS

Marks the end of a conditional loop encompassed by REPEAT and UNTIL. The condition is given

after the UNTIL statement and while evaluated as TRUE, will continue to iterate through the loop.

Once the UNTIL condition is evaluated as FALSE, the loop exits.

REPEAT

var = var + 1

PRINT “ “, var * var; REM prints “ 1 4 9 16 25”

UNTIL (var = 5)

UNTIL

Returns the given string as all uppercase.

PRINT UPPER$(“Hello World”)

REM prints “HELLO WORLD”

UPPER$ (string)

Used with the PRINT statement to specify the format of the given number. Format is specified

using hashes (“#”). If more hashes are provided than needed, the beginning is space filled, the

end zero-padded. If not enough hashes are given before the decimal, the hash format is returned.

PRINT 26.25345 USING “##.###” REM prints “26.253”

var = 1028.265

PRINT var USING “####.####”

REM prints “1028.2650”

PRINT var USING “#######” REM prints “ 1028”

PRINT var USING “##.##”

REM prints “##.##”

USING

Returns a number for the given string.

var = VAL(“26.250”)

PRINT var

REM prints “26.25”

PRINT VAL(“ 22”)

REM prints “22”

PRINT VAL(“a 22”)

REM prints “0”

var$ = “128.5”

PRINT VAL(var$)

REM prints “128.5”

VAL (string)

Marks the end of a conditional WHILE-WEND loop. END WHILE may also be used instead of

WEND.

WHILE (var < 10)

PRINT “ “, var;

var = var + 1.5

WEND

REM prints “ 0 1.5 3 4.5 6 7.5 9”

WEND

Advertising