Tandy 1000 Basic Reference Manual page 262

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10 I
BASIC Keywords
PEN/Trap
Statement
PEN action
T u r n s on, t u r n s off, or temporarily h a l t s l i g h t pen event
trapping,
Actwn
may be any of the following:
ON
enables event trapping
OFF
disables event trapping.
STOP
temporarily suspends event trapping.
Use the
PEN/Trap
statement in a light pen trap routine with
the ON PEN statement to detect when the light pen has been
activated.
The PEN ON statement turns on the trap. BASIC checks after
each program line to see if the light pen has been activated. If
so, BASIC transfers program control to the line number specified
in the ON PEN GOSUB statement.
The PEN STOP statement temporarily halts light pen trapping.
If the light pen is activated, BASIC does not transfer program
control to the ON PEN GOSUB statement until you turn on
trapping again by executing a PEN ON statement. BASIC re-
members that the light pen was activated and branches to the
subroutine immediately after trapping is turned on again.
The PEN
OFF
statement turns off light pen trapping. BASIC
does not remember if the light pen was activated when trapping
is turned on again.
You must also use PEN ON before executing the PEN function.
See ON PEN GOSUB for more information about light pen
trapping.
260

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents