Function ErrorLevel() Foundation
Sets the return code for an Xbase++ application.
ErrorLevel( [<nReturnCode>] ) --> nLastReturnCode
The return value of ErrorLevel() is the current return code of the Xbase++ application. The default value is zero.
Using the environment function ErrorLevel(), the return code of an Xbase++ application can be retrieved and/or redefined. It works like the function Set(). This means that if <nReturnCode> is specified, the function returns the old return code and inserts the new value as the current return code. When no argument is passed, the function provides the current return code. After completion of an Xbase++ application this value can be retrieved at the operating system level using ERRORLEVEL within a batch file.
By default the return code of an Xbase++ application is 0 when the program terminates normally. If a runtime error occurs, the return code is set to 1 by the default error handling routine before the program is terminated with QUIT.
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.