Xl™ series – Xylem XL-BASIC Programming Guide User Manual

Page 9

Advertising
background image

XL™ SERIES

XL-BASIC Programming Guide 23-9

XL-BASIC Language Command Descriptions:

Except for functions that have parameters using parentheses, all commands should be followed
by a space. Normally keeping only one command on a line will make the program easier to read
and understand. This also will cut down on programming errors. Commands may be entered in
either upper or lower case.

--- Program Flow / Control Commands —

REM

This is a ‘Remark’ command. This is used to document the program and
is used the same as in standard BASIC. Any text after the ‘REM”
command will be ignored until the next line. It is always a good practice
to document the program. This helps explain the purpose of the program
and documents any special operations of the program. Program flow
should always be documented so it can be easily followed in debugging.

DELAY(####)

Delay #### milliseconds, where #### is 0 to 65000

Example:

Delay(1000) Rem delay for 1.0 second

GOSUB ####

Go to a subroutine indicated by #### where #### is a numeric label at the
beginning of a line, (no alpha characters. See the GOTO command for
more information on the label limitations).
There should be a return statement at the end of the subroutine.
There can be 5 nested GOSUB sections.

Example:

gosub 2000
end

2000
print "this is a subroutine"
return

RETURN

Each subroutine must end with a return statement.
See the gosub command.

GOTO ####

Go to a different part of the code indicated by #### where #### is a
numeric label at the beginning of a line, (no alpha characters). There is no
automatic return operation like the gosub uses. There must be a space
between the command and the line number label. There may be up to 50
numeric labels in a program. Labels must be whole numbers in the range
of 0000 to 9999.

Advertising