$FUNCNAME$
  ERRORLEVEL()
$CATEGORY$
  SYSTEM,ENVIRONMENT
$SUMMARY$
   Set the xClipper return code
$LANG_RU$
      xClipper-.
$SYNTAX$
     ERRORLEVEL([<nNewReturnCode>]) --> nCurrentReturnCode
$LANG_RU$
     ERRORLEVEL([< >]) -->   
$ARGUMENTS$
     <nNewReturnCode> is the new return code setting.  This can be a
     value between zero and 255.  The default value at startup is zero.  If
     not specified, ERRORLEVEL() reports the current setting without
     assigning a new value.
$LANG_RU$
     < > -    .   
       0  255.       0. 
       , ERRORLEVEL()    , 
       .
$RETURNS$
     ERRORLEVEL() returns the current xClipper exit code as a numeric
     value, if one has been set using ERRORLEVEL() with an argument;
     otherwise, it returns zero.
$LANG_RU$
     ERRORLEVEL()     xClipper  
     ,       ERRORLEVEL() 
     ;      .
$DESCRIPTION$
     ERRORLEVEL() is a dual purpose environment function.  It returns the
     current xClipper return code and optionally sets a new return code.
     The return code is a value set by a child process so the parent process
     can test the termination state of the child process.  Typically, the
     parent process is OS and the child process is an application program.
     Retrieve a return code with the OS ERRORLEVEL command or INT 21
     Function 4Dh.

     When a xClipper program terminates, the return code is set to 1 if the
     process ends with a fatal error.  If the process ends normally, the
     return code is set to zero, or the last ERRORLEVEL() set in the program.

     Typically, you would set a return code with ERRORLEVEL() to indicate an
     error state to the program that invoked the current xClipper program.
     In most cases this is the application batch file.  Here you would test
     the return code using the OS ERRORLEVEL command.  Refer to your OS
     manual for more information.
$LANG_RU$
     ERRORLEVEL()      .
          xClipper  
        .   
     ,   ,  
           .
       -     OS, 
       -  .   
          OS ERRORLEVEL  
     INT 21  4Dh.

       xClipper-     1,
         .  
             
       ERRORLEVEL(),   .

           ERRORLEVEL(), 
        ,    
     xClipper.        
     .      
      OS ERRORLEVEL.      
       OS.
$EXAMPLES$
       This example saves the current xClipper return code, then
	sets a new value:

	nOldCode := ERRORLEVEL()      // Get current error level
	ERRORLEVEL(1)                 // Set new error level

       This example uses ERRORLEVEL() to set a return code that can
	be tested by the parent process:

	#define ERR_FILE_MISSING      255
	#define ERR_POST_INCOMPLETE   254
	//
	IF !FILE("Sysfile.dbf")
	   @ 0, 0
	   @ 1, 0
	   @ 0, 0 SAY "Fatal error: System ;
		       file is missing...quitting"
	   ERRORLEVEL(ERR_FILE_MISSING)
	   QUIT
	ENDIF
$LANG_RU$
             xClipper 
          :

       nOldCode = ERRORLEVEL()   //    
       ERRORLEVEL(1)             //   

          ERRORLEVEL()  
        ,     
       :

       #define ERR_FILE_MISSING 255
       #define ERR_POST_INCOMPLETE 254
       //
       IF !FILE("Sysfile.dbf")
	  @ 0, 0
	  @ 1, 0
	  @ 0, 0 SAY " :  ... "
	  ERRORLEVEL(ERR_FILE_MISSING)
	  QUIT
       ENDIF
$SEEALSO$

$END$
