Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : QUIT statement
 

QUIT statement

Raises the QUIT condition. By default, this exits from the ABL session and returns to the operating system.
When QUIT is executed from within a procedure running on an AppServer, it terminates the ABL session running on the AppServer, causing the AppServer agent to shut down and returns to the ABL client session from which it was spawned.
When QUIT is executed from within a procedure running on a Progress Application Server for OpenEdge (PAS for OpenEdge), the ABL session is reset to its initial state, which includes deletion of persistent procedures and static ABL objects, the disconnection of databases (or re-connection if the databases were connected at startup), and the clean-up of all global data, such as shared variables. Control then returns to the ABL client session from which the server session was accessed, and the server session is returned to its PAS for OpenEdge session pool for access by other client requests.
Note: Does not apply to SpeedScript programming.

Syntax

QUIT

Example

This procedure displays a menu. If you choose the last menu item, Exit ABL, the procedure processes the QUIT statement.
r-quit1.p
DEFINE SUB-MENU cusmaint1
  MENU-ITEM crecust LABEL "Create New Customer"
  MENU-ITEM chgcust LABEL "Chan&ge Existing Customer"
  MENU-ITEM delcust LABEL "Delete Customer"
  MENU-ITEM prtcust LABEL "Print Customer List"
  MENU-ITEM extcust LABEL "E&xit ABL".

DEFINE MENU mainbar MENUBAR
  SUB-MENU cusmaint1 LABEL "Customer".

ON CHOOSE OF MENU-ITEM crecust
  RUN newcust.p.

ON CHOOSE OF MENU-ITEM chgcust
  RUN chgcust.p.

ON CHOOSE OF MENU-ITEM delcust
  RUN delcust.p.

ON CHOOSE OF MENU-ITEM prtcust
  RUN prncust.p.

ON CHOOSE OF MENU-ITEM extcust
  QUIT.

ASSIGN
  CURRENT-WINDOW:MENUBAR = MENU mainbar:HANDLE
  CURRENT-WINDOW:VISIBLE = TRUE.

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

Notes

*To modify the QUIT statement, add the ON QUIT phrase to a block.
*If QUIT is executed during a transaction, the AVM commits the transaction before exiting.
*In a PAS for OpenEdge application, you typically use this statement for a client connected using the session-managed application model, where you want to emulate the behavior of an AppServer running in the state-reset operating mode. In this case, you execute QUIT as the final statement in the PAS for OpenEdge Disconnect procedure after setting the SERVER-CONNECTION-BOUND-REQUEST attribute on the SESSION handle to FALSE. This cleans up the server session for access by the next client request that also emulates access to an AppServer in the state-reset operating mode.

See also

ON QUIT phrase, STOP statement