Revision 1.1
WebSwitch™ Users Manual
CALL
The CALL statement is found within the main body of code, but requires the interpreter to skip to a
subroutine found at the end of the program. After the subroutine is finished, the interpreter returns to the
line immediately following the CALL statement. The format is:
CALL (name of subroutine)
SUB, END SUB
The SUB statement defines the beginning and name of a subroutine. The END SUB statement defines
the end of the respective subroutine. Subroutine names can be up to 20 characters long and are case
sensitive. The SUB and END SUB statements always must follow the END statement. The format is:
END
SUB (name of subroutine)
(contents of subroutine)
END SUB
REM
or
'
The REM or ( ' ) statement designates remarks made by the programmer. The interpreter will disregard
any characters following these statements.
The PRINT statement outlets a variable or message (if contained within quotation marks). Note that the
PRINT statement is only available for the PC version of the BASIC interpreter. The device will not
recognize the command. The format is:
PRINT (variable)
'outlet variable value to screen
PRINT "(message)"
'outlet '(message)' to screen
Variables
Two types of variables are available for use in the ControlByWeb™ BASIC interpreter - user-defined
variables, and useful predefined variables.
User-Defined Variables
Up to 10 user-defined variables are allowed to be used in scripts. Variables are represented by single,
lower-case characters ranging from the letter 'a' to the letter 'j' in the English alphabet. They are always
global and stored internally as floating point numbers. Variables are defined using the LET statement.
Examples:
Let b = 5
'variable b will be set to 5
Let d = b + 2
'variable d will be set to 7
The following are useful predefined variables for the ControlByWeb™ BASIC interpreter. Note that some
models may not contain digital inputs, analog inputs and/or relays and thus would not have digital input,
analog input and/or relay variables.
Xytronix Research & Design, Inc.
101