Microsoft KB Archive/57342

= Light Pens Tested with Microsoft Basic =

Article ID: 57342

Article Last Modified on 11/21/2006



This article was previously published under Q57342



SUMMARY
The following light pens by the LightPen Company were tested with QuickBasic Version 4.50, Microsoft Basic Compiler Versions 6.00 and 6.00b, and Microsoft Basic Professional Development System (PDS) Version 7.00:


 * 1) Light Pen
 * 2) Soft Pen



MORE INFORMATION
The following code example is from Page 315 of the &quot;Microsoft QuickBasic 4.0: Basic Language Reference&quot; manual under the example for the PEN function. This code example was used to test the light pen. If you do not have a light pen, pushing both buttons on the mouse at the same time simulates a light pen being on.

The code produces an endless loop to give the current position and status of the pen.

Compile and link with the following command lines:

BC test.bas; LINK test.obj,,,BRUNxx.Lib;

Code Example
CLS PEN ON DO  p = PEN(3) LOCATE 1,1: PRINT &quot;Pen Is &quot;; IF p THEN PRINT &quot;down&quot; ELSE PRINT &quot;up&quot; x = PEN (4) : y = PEN(5) PRINT &quot;x=&quot; x, &quot;y=&quot; y LOOP

Additional query words: QuickBas BasicCom

Keywords: KB57342

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.