DRAW Statement to Erase or Redraw Image May Not Work Correctly (67205)



The information in this article applies to:

  • Microsoft QuickBASIC 2.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 2.01, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 3.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.0b, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.5, when used with:
    • the operating system: MS-DOS
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft GW-BASIC 3.2
  • Microsoft GW-BASIC 3.22
  • Microsoft GW-BASIC 3.23

This article was previously published under Q67205

SYMPTOMS

Under some circumstances the DRAW statement will incorrectly redraw the same figure.

A common method of erasing an image is to draw an image with the drawing color and then redraw it with the background color. However, as this article describes, it is possible that DRAWing the exact same picture over the previously drawn picture may not completely erase the image, resulting in "droppings" being left on the screen.

STATUS

Microsoft has confirmed this to be a bug in Microsoft QuickBasic Compiler versions 2.00, 2.01, 3.00, 4.00, 4.00b, and 4.50 for MS-DOS; in Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b) for MS-DOS and MS OS/2; in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 (buglist7.00, buglist7.10) for MS-DOS and MS OS/2; and in Microsoft GW-Basic Interpreter versions 3.20, 3.22, and 3.23 (buglist3.20, buglist3.22, buglist3.23). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When the DRAW command "TA" is executed, the angles calculated should be consistent. However, a second iteration of the same command with a different color produces a slightly different image.

The problem seems to occur only in certain examples, regardless of the screen mode or product version used. Microsoft has duplicated this problem only when using the "TA" angle rotation command in conjunction with a "B" (move but don't plot) command.

The code example below demonstrates this problem. The program below continually draws a line and then immediately redraws that line with the background color to erase the line. On each iteration of the loop, the angle of the line is rotated. For a few of the lines, the DRAW command will not completely erase some of the lines drawn.

Code Example

SCREEN 9: CLS
L$ = "U65 BU5 D70"
DO
 
        FOR i = 0 to 360 STEP 3
                DRAW "C14TA=" + VARPTR$(i) + L$
                DRAW "C0TA=" + VARPTR$(i) + L$
        NEXT i
 
LOOP UNTIL INKEY$ <> ""
END
				
In this specific example, the "BU" command must be in the DRAW string or the problem will not occur.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB67205