Microsoft KB Archive/33053

= PRINT or BEEP &quot;Error 11&quot; in QuickBASIC Compiled apl Program =

Article ID: 33053

Article Last Modified on 11/21/2006



This article was previously published under Q33053



SUMMARY
A program compiled in Microsoft QuickBASIC for Macintosh gives &quot;Error 11&quot; (which means &quot;Division by Zero&quot;) at run time when it PRINTs to the screen if no window is defined and &quot;Use Default Window&quot; was not selected in the &quot;Options...&quot; dialog box at compile time. The BEEP statement also gives &quot;Error 11&quot; when not using the &quot;Use Default window&quot; option (because QuickBASIC internally translates the BEEP statement into a series of PRINT statements).

If the &quot;Use Default Window&quot; is not selected when compiling, you are responsible for creating a window before using the BEEP or PRINT statement or other screen output.



MORE INFORMATION
Note that the &quot;Use Default Window&quot; option is always &quot;on&quot; in the interpreter environment in QuickBASIC, so Error 11 will not occur for BEEP or PRINT when run in the interpreter. This difference in behavior between interpreted and compiled programs may confuse some programmers who are not familiar with the cause of &quot;Error 11&quot; in the context of not using a default output window.

The &quot;Use Default Window&quot; option was provided only for compiled (&quot; apl&quot;) programs so that they could smoothly initiate a windowless screen (without a default window flashing then disappearing with the first WINDOW or WINDOW CLOSE statement).

If you want to use the BEEP statement and also want to not compile with the &quot;Use Default Window&quot; option, create a window out of sight behind the menu bar, such as the following: WINDOW 1,&quot;Invisible&quot;,(1,1)-(15,15)

Additional query words: MQuickB

Keywords: KB33053

-

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

© Microsoft Corporation. All rights reserved.