qb45advr.hlp (Topic list)
PEN Function Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
PEN Function Programming Example
 
This example produces an endless loop to print the current pen-switch
status (UP/DOWN). Press CTRL+BREAK to exit the loop.
 
                                ----- Note -----
          Do not run this example if your mouse driver is enabled.
                                ----------------
' You will have to press CTRL+BRK to exit this loop
COLOR 0,7
CLS                ' Clear screen
PEN ON
DO
   P = PEN(3)
   LOCATE 1,1 : PRINT "PEN IS ";
   IF P THEN PRINT "DOWN" ELSE PRINT "UP  "
   X = PEN(4) : Y = PEN(5)
   PRINT "X =" X, "Y =" Y; "  "
LOOP
COLOR 7,0
END