xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

QUIT

Terminates program execution unconditionally.

Syntax

QUIT

Description

The QUIT command terminates program execution unconditionally. Before control goes back to the operating system, all files are closed and all EXIT PROCEDURES are executed, unless a runtime error occurs during program shutdown. In this case, the ErrorLevel() function is set to 1 which is the applications's return code to the operating system.

Info

See also:BEGIN SEQUENCE, Break(), ErrorLevel(), EXIT PROCEDURE, RETURN, TRY...CATCH
Category: Memory commands
Source:vm\initexit.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows a typical usage of the QUIT command for a
// command line utility that relies on a command line parameter
// to work properly

   PROCEDURE Main( cFileName )

     CLS
     IF Empty( cFileName ) .OR. ! File( cFileName )
        ? "Usage myApp.exe <fileName>"
        QUIT
     ENDIF

     <file processing>

  RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe