Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
PEN Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
PEN {ON | OFF | STOP}
Usage Notes
■ If your program contains event-handling statements and you are compiling
from the BC command line, use the /W or /V option. If you do not use
these options and your program contains event traps, Visual Basic
generates the error message, "ON event without /V or /W on command
line." See: ◄BC Command-Line Options►
■ PEN ON enables lightpen-event trapping. A lightpen event occurs
whenever the lightpen is activated by pressing the tip to the screen
or pressing the touch ring. If a lightpen event occurs after a PEN ON
statement, the routine specified in the ON PEN statement is
executed.
■ PEN OFF disables lightpen-event trapping so no trapping takes place
until another PEN ON statement is executed. Events occurring while
trapping is off are ignored.
■ PEN STOP suspends lightpen-event trapping so no trapping takes place
until a PEN ON statement is executed. Any ON PEN events that occur while
trapping is suspended are remembered and processed when the next PEN ON
statement is executed. However, remembered events are lost if PEN OFF
is executed.
■ When a lightpen event trap occurs (that is, the GOSUB is performed),
an automatic PEN STOP is executed so that recursive traps cannot take
place. The RETURN from a trapping routine automatically executes
a PEN ON statement unless an explicit PEN OFF was performed inside
the routine.
■ PEN ON must be executed before you use the PEN function. If you try
to execute the PEN function when the lightpen is off, Basic generates
the error message, "Illegal function call."