Microsoft KB Archive/47567

= BUG: LCOPY Prints Mouse Cursor after HIDECURSOR =

Article ID: 47567

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q47567



SYMPTOMS
The LCOPY statement in QuickBasic for Macintosh incorrectly prints the mouse's &quot;watch&quot; cursor (pointer) after a CALL to the ROM routine HIDECURSOR.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic Version 1.00 for Macintosh. Microsoft is researching this problem and will post new information as it becomes available.

In earlier versions, such as Microsoft Basic Interpreter 3.00 or Microsoft Basic Compiler 1.00, LCOPY correctly does not print the mouse's &quot;watch&quot; cursor after a CALL to the ROM routine HIDECURSOR.



Workaround
The following program, which contains the subprogram PrintScreen, is a modification of the sample program on Page 172 of &quot;Microsoft QuickBasic for Macintosh : Language Reference.&quot; This routine, which uses the graphics GET statement, is not affected by the ROM routines HIDECURSOR and SHOWCURSOR. The cursor will be correctly hidden and restored without appearing on the printout.

The PrintScreen subprogram (along with a PrintWindow subprogram) is also found as part of the Utility Subprograms file in the QB Demos folder on the Examples disk for QuickBasic 1.00 for Macintosh. Unlike LCOPY, PrintScreen works for color screens and LaserWriters.

Code Example
' You may run this program interpreted or compiled. ' Since this program uses a dynamic array, it must be compiled ' without the &quot;Make All Arrays Static&quot; option. PRINT &quot;Press RETURN to hide the mouse cursor&quot; INPUT &quot;and PRINT the screen&quot;;a$ HIDECURSOR ' The PrintScreen subprogram works correctly. ' The mouse cursor will NOT be printed. '  *** Uncomment the following line to show the workaround: ' PrintScreen 0,0,0

' LCOPY will cause the mouse cursor to appear both on '  the screen and the printout. ' *** Comment out the following line to demonstrate the '     workaround above. LCOPY PRINT &quot;Right now, the cursor will not be hidden if LCOPY&quot; PRINT &quot;was used but will be hidden if PrintScreen was used.&quot; INPUT &quot;Hit RETURN to continue.&quot;;a$ SHOWCURSOR END

SUB PrintScreen(scale%,x%,y%) STATIC max&=(4+(SYSTEM(6)+1)*2*INT((SYSTEM(5)+16)/16))/8+1 IF FRE(0) < max&*8+26 OR max&>32767 THEN BEEP:EXIT SUB END IF DIM origin%(1),Screen#(max&) LocalToGlobal pt%(0) x2 = SYSTEM(5)-origin%(1) y2 = SYSTEM(6) - origin%(0) GET (-origin%(1),-origin%(0))-(x2,y2),Screen# OPEN &quot;lpt1:&quot; FOR OUTPUT AS #10 WINDOW OUTPUT #10 IF scale% THEN PUT (0,0)-(x%,y%),Screen# ELSE PUT (0,0),Screen# CLOSE #10 ERASE origin%,Screen# END SUB

Additional query words: MQuickB

Keywords: kbbug KB47567

-

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

© Microsoft Corporation. All rights reserved.