PEN(5) Function in SCREEN 9 Returns Only 0 or 1 with Mouse (33044)






This article was previously published under Q33044

SYMPTOMS

The PEN(5) function returns only a value of 0 or 1 instead of the actual y pixel coordinate when using the Microsoft Mouse in SCREEN 9, 10, 11, or 12 (which are screen modes with resolutions of 640 x 350 or greater). This problem occurs both inside the QB.EXE environment and as a compiled .EXE program.

STATUS

Microsoft has confirmed this to be a bug in Microsoft QuickBasic Versions 3.00, 4.00, 4.00b, and 4.50, in Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS, and in Microsoft Basic PDS Version 7.00 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The problem does not occur in SCREENs 1, 2, 7, 8, or 13, which have resolutions lower than 640 x 350.

The following program hangs the machine in QuickBasic 4.00:
SCREEN 9
CLS
PEN ON
true = -1
WHILE true
   x = PEN(4)         'x pixel coordinate
   y = PEN(5)         'y pixel coordinate
   PRINT "X= "x, "Y= "y
WEND
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB33044