Toshiba KB-80 Computer Keyboard User Manual


 
- 50 -
ON COM
Function Declares an interrupt which occurs when the data is input into the communication
buffer, and declares the start line number for the subroutine to be executed.
Format ON COM ( <line number> ) GOSUB <line number>
Term <line number>: The line number to which an interrupt is processed (1 or 2)
<line number>: The line number from which the subroutine for the interrupt process
is started should be specified.
Explanation The ON COM statement declares the interrupt process for receiving data only, and
does not execute the process.
When the ON COM statement is executed, BASIC checks whether or not data is
received in the specified line while executing the program. When data reception is
confirmed in the specified line, the interrupt process routine is executed if an interrupt
is enabled by the COM (n) ON statement. When “0” is specified in <line number>,
the interrupt process is disabled. To prevent another interrupt process from being
received during the execution of the first interrupt process, the COM (n) STOP
statement is automatically executed if the interrupt process is being executed. When
the RETURN statement for terminating the subroutine is sent, the program is returned
to the previous state.
An interrupt occurs only when the program is executed.