PRINT or BEEP "Error 11" in QuickBASIC Compiled apl Program (33053)






This article was previously published under Q33053

SUMMARY

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

If the "Use Default Window" 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 "Use Default Window" option is always "on" 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 "Error 11" in the context of not using a default output window.

The "Use Default Window" option was provided only for compiled (" apl") 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 "Use Default Window" option, create a window out of sight behind the menu bar, such as the following:
   WINDOW 1,"Invisible",(1,1)-(15,15)
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB33053