QBasic 1.1: PEN Statement

Syntax

PEN ON
PEN OFF
PEN STOP
ON PEN GOSUB line

Description / Parameter(s)

PEN ON Enables light-pen event trapping.
PEN OFF Disables light-pen event trapping.
PEN STOP Suspends light-pen event trapping. Events are processed once event trapping is enabled by PEN ON.
line The label or number of the first line of the event-trapping subroutine.

Example

'This example requires a light pen. ON PEN GOSUB Handler PEN ON PRINT "Press Esc to exit." DO UNTIL INKEY$ = CHR$(27): LOOP END Handler: PRINT "Pen is at row"; PEN(6); ", column"; PEN(7) RETURN