MainWin.
Terminates the application by closing all open windows, including the main window.
mainwin.Exit ( )
Exit terminates the application containing the main window. It first closes all open application windows and then closes the application itself.
Exit starts with the current active window and attempts to close it using the following sequence, stopping when the window closes:
Once one window closes, Exit follows the sequence with the next active window, until all windows are closed.
When closing any window causes the application to display a confirmation dialog, Exit attempts to close the dialog using the list of buttons specified in the OPT_CLOSE_CONFIRM_BUTTONS option.
If the windows cannot be closed (for example, because the application displays a message box that cannot be closed with the buttons specified in OPT_CLOSE_CONFIRM_BUTTONS), Exit unconditionally terminates the application and issues a warning.
If the application does not terminate normally, Exit prints the following message to the Results file:
*** Warning: Application not terminated cleanly
This method supports several options for specifying how a window should be closed:
To specify | Set this option | Or set this variable |
---|---|---|
To use non-standard buttons to close a confirmation dialog | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons |
To use non-standard buttons to close a window | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons |
To use non-standard menu items to close a window | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus |
To use non-standard keyboard input to close a dialog | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys |
You can make these specifications using either the SetOption method, by defining the specified variable, or by using the settings in the Close panel on the Agent Options dialog.
[-] if (TextEditor.Exists ()) [ ] TextEditor.SetActive () [ ] TextEditor.Exit ()