Programming instructions
Intermec Fingerprint v7.61 – Programmer’s Reference Manual Ed. 7  175
Chapter 2 Program Instructions
ON COMSET GOSUB 
Field of Application
 Statement for branching to a subroutine, when the background reception 
of data on the specifi ed communication channel is interrupted.
Syntax ON
↔
COMSET<nexp
1
>GOSUB<nexp
2
>|<line label>
<nexp1> is one of the following communication channels:
 0 = "console:"
 1 = "uart1:"
 2 = "uart2:"
 3 = "uart3:" 
 4 = "centronics:"
 6 = "usb1:"
<nexp
2
>/<line label>  is number or label of the program line to be branched to.
Remarks
 This statement is closely related to COMSET, COMSTAT, COMSET ON, 
COMSET OFF, COM ERROR ON/OFF, and COMBUF$. It is used to branch 
to a subroutine when one of the following conditions occur:
 - End character is received.
 - Attention string received.
 - Max. number of characters received.
 These  three  parameters  are  set  for  the specifi ed communication channel 
by a COMSET statement.
Examples
 In this example, the program branches to a subroutine for reading the buffer 
of the communication channel:
  1   REM Exit program with #STOP&
  10   COMSET1,"#","&","ZYX","=",50
  20   ON COMSET 1 GOSUB 2000
  30   COMSET 1 ON
  40   IF A$ <> "STOP" THEN GOTO 40
  50   COMSET 1 OFF
  .....
  .....
  1000   END
  2000   A$= COMBUF$(1)
  2010   PRINT A$
  2020   COMSET 1 ON
  2030   RETURN










