Microsoft KB Archive/67205

= DRAW Statement to Erase or Redraw Image May Not Work Correctly =

Article ID: 67205

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 2.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 2.01, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 3.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBASIC 4.0b, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.5 for MS-DOS, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 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 &quot;droppings&quot; 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 &quot;TA&quot; 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 &quot;TA&quot; angle rotation command in conjunction with a &quot;B&quot; (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$ = &quot;U65 BU5 D70&quot; DO FOR i = 0 to 360 STEP 3 DRAW &quot;C14TA=&quot; + VARPTR$(i) + L$               DRAW &quot;C0TA=&quot; + VARPTR$(i) + L$        NEXT i LOOP UNTIL INKEY$ <> &quot;&quot; END In this specific example, the &quot;BU&quot; command must be in the DRAW string or the problem will not occur.

Additional query words: QuickBas BasicCom buglist3.00 buglist2.01 buglist2.00 buglist4.00 buglist4.00b buglist4.50

Keywords: KB67205

-

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

© Microsoft Corporation. All rights reserved.