Command QUIT Foundation

Ends an Xbase++ program.

Syntax
QUIT | CANCEL [<nErrorLevel>]
Parameters
<nErrorLevel>
As an option, a numeric parameter can be specified. It is passed to the function Errorlevel() before the program ends.
Description

The command QUIT (or CANCEL) ends an Xbase++ program and returns control to the operating system. Before termination, all files in all work areas are closed and all outstanding file updates are completed. When a program is ended normally, its return value is zero. If an error occurred, the return value is one. This value can be retrieved on the operating system level. It also can be specified as a numeric parameter <nErrorLevel> or be set explicitly by using the function ErrorLevel() before the program ends.

Examples
QUIT
// The example shows a general structure for a 
// program loop which is ended only at the user's 
// request. 

PROCEDURE Main 

   DO WHILE .T. 
      ? "Program is running" 

      Inkey(0) 

      IF Alert( "Do you want to terminate program?", ; 
                {"Yes","No"} ) == 1 
         QUIT 
      ENDIF 
   ENDDO 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.