Specifications
Commands - 77
ON COM$
Tasking Statement
SYNTAX: ON COM$ n GOSUB line/label
ON COM$ n GOSUB
PURPOSE: To define a program branch when a task defined by the CONFIG COM$ statement becomes valid.
REMARKS: After defining all the parameters with CONFIG COM$ the ON COM$ activates the task. You can
deactivate the task by executing the same statement but without a line number after GOSUB.
n = legal serial port number.
See the Multitasking Chapter for more information.
RELATED: CLEAR COM$, COM$, CONFIG COM$
EXAMPLE: 10 CONFIG COM$ 2,0,8,0,1
20 ON COM$ 1 GOSUB 80
30 'your program goes here
.
80 PRINT COM$(2)
90 RETURN
In this example the program will branch when 8 characters have been received. The XON and
protocol functions are disabled. All characters will be echoed.
ERROR: <Data negative> – n
<Data out of range> – if n is not a legal serial port number
<Can’t compile> – if line/label does not exist