BUG: LCOPY Prints Mouse Cursor after HIDECURSOR (47567)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q47567

SYMPTOMS

The LCOPY statement in QuickBasic for Macintosh incorrectly prints the mouse's "watch" 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 "watch" cursor after a CALL to the ROM routine HIDECURSOR.

MORE INFORMATION

Workaround

The following program, which contains the subprogram PrintScreen, is a modification of the sample program on Page 172 of "Microsoft QuickBasic for Macintosh : Language Reference." 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 "Make All Arrays Static" option.
PRINT "Press RETURN to hide the mouse cursor"
INPUT "and PRINT the screen";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 "Right now, the cursor will not be hidden if LCOPY"
PRINT "was used but will be hidden if PrintScreen was used."
INPUT "Hit RETURN to continue.";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 "lpt1:" 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
				

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:kbbug KB47567