Microsoft KB Archive/40712

= BUG: SetOrigin Diff in Compiled vs. Interpreted Mac QuickBasic =

Article ID: 40712

Article Last Modified on 11/21/2006



This article was previously published under Q40712



SYMPTOMS
The SetOrigin routine can be either called by name (with the SetOrigin MBLC routine built into QuickBasic), or invoked with the ToolBox statement (which can invoke the equivalent ROM trap).

The SetOrigin routine works differently when compiled rather than interpreted in QuickBasic version 1.0 for the Macintosh. SetOrigin appears to work differently than documented for the interpreter and compiler.

After invoking SetOrigin in a compiled program (either with the SetOrigin MBLC routine or the ToolBox ROM function call), subsequent graphics routines (such as CIRCLE or LINE) can only draw to coordinates where both x and y components are positive.

On the first run in the interpreted mode, the program behaves the same as the compiled version. But if you abort the program and run it a second time in the interpreter in the same session of QuickBasic, the program will then display graphics correctly, including negative x and y components.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic version 1.0 for Macintosh systems. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The following program demonstrates the problem: WHILE a$<>&quot;q&quot; INPUT &quot;Enter x coordinate: &quot;,a% INPUT &quot;Enter y coordinate: &quot;,b% CLS setorigin (-a%),(-b%) circle (0,0),20 ' A full circle should be drawn. call lineto(-a%,-b%) ' A long diagonal line should be drawn. a$=&quot;&quot; WHILE a$=&quot;&quot;:a$=INKEY$:WEND WEND In the compiled version, only the circle's lower right-hand quadrant (where both x and y coordinates are positive) is drawn. In the interpreted version, the full circle is correctly drawn on the second loop iteration or second program run during that session of QuickBasic.

Additional query words: MQuickB

Keywords: kbbug KB40712

-

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

© Microsoft Corporation. All rights reserved.