Tandy 1000 Basic Reference Manual page 126

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10
I
BASIC Ke.ywords
COM
Statement
COM(channe1) action
Turns on, turns off, or temporarily halts the trapping of activity
on the specified communications channel.
Channel selects communications channel 1 or 2.
Action may be any of the following:
ON
enables communications trapping.
OFF
disables communications trapping.
STOP
temporarily suspends communications trapping.
Use the COM statement in a communications trap routine with
the ON COM() GOSUB statement to detect when characters
have come into the communications channel.
The COM(
)
ON statement turns on the trap. BASIC checks after
every program statement to see if a character has come into the
communications channel. If so, BASIC transfers program control
t o t h e line number specified i n t h e ON COM() GOSUB
statement
.
The COM(
)
STOP statement temporarily halts communications
trapping. If activity occurs on the communications channel,
BASIC does not transfer program control to the
ON
COM(
1
GO-
SUB statement until you t u r n on communications trapping
again by executing a COM() ON statement. BASIC remembers
that activity took place and branches
t o
the subroutine immedi-
ately after communications trapping is turned on again.
The COM(
)
OFF statement turns off communications activity
trapping. BASIC does not remember if activity took place when
communications trapping is turned on again.
W e recommend that your trap routine read the entire message
from the communications port. Do not use a COM trap to trap a
single character message because the amount of time required
t o trap and read every character can cause the communications
buffer t o overflow.
124

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents