Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>on com trap for communications activity</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ON COM                   Trap for Communications Activity

 ON COM(n) GOSUB {linenum | linelabel}

    Specifies a subroutine to which Turbo Basic will branch if it detects
    activity at a specified communications port. The trap must also be
    turned on by means of a COM(n) ON statement.

           n    A numeric expression. Must be either 1, for COM1:, or 2,
                for COM2:.

     linenum    The first line of a communications-handling subroutine.
                Setting linenum to 0 disables trapping.

   linelabel    A label identifying the first line of a communications-
                handling subroutine.

   --------------------------------------------------------------------------

      Notes:    With communications trapping in effect, Turbo Basic checks
                for data at the specified communications port. When
                activity is detected, Turbo Basic branches to the
                specified subroutine and temporarily suspends trapping (by
                means of an implicit COM(n) STOP statement). Trapping
                automatically resumes when a RETURN from the
                communications-handling subroutine is executed (unless the
                communications-handling routine explicitly performs a
                COM(n) OFF or COM(n) STOP).

                With event trapping in effect, Turbo Basic checks for the
                specified event after each program statement. The $EVENT
                metastatement can be used to turn event trapping on and
                off at specified points within a program.

See Also: $EVENT COM(n)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson