From Xojo Documentation

Revision as of 14:23, 12 November 2019 by PLefebvre (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Quits the application.



Part Type Description
status Integer For console applications only, the optional parameter returns a status code.

When you call Quit, it will terminate your application and returns the status code in status.


Calling the Quit method will call the Application class's CancelClose event. To cancel the close, return True from this event. If it does not return True, each window's CancelClose event handler is called. CancelClose and Close are called as a pair for each open window.

If a CancelClose event handler returns False (the default action) then the window's Close event handler is called. If any window's CancelClose event handler returns True, the app will not quit and no further CancelClose or Closing events will be called.

An EndException is raised when you call Quit. It causes the app to quit gracefully. Usually you do not see the EndException unless you use a "catch-all" Exception statement.

If you just need to have your app quit when last window is closed, you can use the Application.AutoQuit property.


This example quits the application.


See Also

Application, QuitMenuItem, EndException classes.