The closewindow statement closes the current window.


No parameters.


This statement closes the currently active window. This statement has the same effect as choosing the Close Window command from the File menu or clicking on the close box for any window.

Note: If closing the window has been disabled (see the setwindowoptions statement), the closewindow statement will not work. If that is a possibility, the code must enable closing before closing the window, like this:

setwindowoptions "closeable","YES"

This code will work whether the window is closeable or not. However, if you wanted to check whether the window is closeable, you can use the windowinfo( function.

The window on which your procedure is currently working is only the currently active window when Panorama X is also the foremost application. The closewindow statement will fail with an error if called when Panorama X is not foremost, for instance if another application has been activated in the time between the commands to open and close the Panorama X window. The statement bringpanoramaforward may be used to ensure that Panorama X is foremost, then the window or originalwindow statements might be useful to ensure the correct window is active if significant time has elapsed since it was opened, before finally using closewindow to close it. For instance:

openform "MyForm"

// Time-consuming procedure code


See Also


10.0No ChangeCarried over from Panorama 6.0.