Microsoft KB Archive/45485
Article ID: 45485
Article Last Modified on 11/21/2006
This article was previously published under Q45485
After closing a WINDOW, the MOUSE(0) function does not reset to 0 in the next opened WINDOW in an application compiled with Microsoft QuickBasic Version 1.00 for the Macintosh .
The MOUSE(0) function should return a 0 (zero) until the mouse button is pressed. When a WINDOW is closed and reopened, the first value returned by the MOUSE(0) function should be 0. In the QuickBasic interpreter, this is exactly how the MOUSE(0) function behaves, but in a compiled application, the first invocation of MOUSE(0) improperly returns a 1 when a closed WINDOW is reopened.
Microsoft has confirmed this to be a bug in Version 1.00. We are researching this problem and will post new information as it becomes available.
To work around this problem, add the statement x=MOUSE(0) to flush the first bad value immediately after the second window is defined, or use the following WHILE statement
WHILE MOUSE(0) <> 1 : WEND
in place of the following:
WHILE MOUSE(0) = 0 : WEND
The following code example waits for a mouse click in the "First Window", but immediately CLOSEs the "Second Window" in a compiled application without an additional click. When run in the interpreter, each WINDOW waits for a separate click.
WINDOW 1,"First Window",(100,100)-(200,200) WHILE MOUSE(0)=0 : WEND WINDOW CLOSE 1 WINDOW 2,"Second Window",(205,205)-(305,305) ' x=MOUSE(0) ' Add this as workaround WHILE MOUSE(0)=0 : WEND WINDOW CLOSE 1
Additional query words: MQuickB
Keywords: kbbug KB45485