Compiled PICTURE ON Statement Renders WINDOW Border Invisible (45691)






This article was previously published under Q45691

SUMMARY

In an application compiled in QuickBASIC Version 1.00 for the Apple Macintosh, executing a PICTURE ON statement (with no subsequent PICTURE OFF statement) prior to a WINDOW statement may cause problems such as loss of window borders and background, or even system bombs.

If your program invokes PICTURE ON, it must always invoke PICTURE OFF before activating another window with a WINDOW statement.

MORE INFORMATION

The PICTURE ON and PICTURE OFF statements were intended to capture output sent to the one current window. This means that changing the current window with another WINDOW statement before you use PICTURE OFF will not capture subsequent output to that window and may cause problems such as loss of graphics, systems bombs, or disabling of MultiFinder. The following program demonstrates the incorrect use of PICTURE ON, PICTURE OFF, and WINDOW:

Code Example

PICTURE ON
SHOWPEN    ' IF THIS LINE IS REMOVED, THE WINDOW WILL BE
           ' INVISIBLE WHEN COMPILED

WINDOW 1,"",(30,50)-(476,309),2

REM THE CODE BELOW SHOWS THE CAPTURE DID NOT WORK
PRINT "hi"
CIRCLE (50,100),50
PICTURE OFF
image$=PICTURE$
WINDOW 2   ' Invokes default Untitled window size and type.
PICTURE (30,50)-(476,309) ,image$
CLOSE 1
WHILE INKEY$="":WEND
STOP
				
To correct this program, move the first two statements, PICTURE ON and SHOWPEN, to be right after the WINDOW 1 statement.

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