qb45advr.hlp (Topic list)
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.
@L8154
:nPEN 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