# EXIT
Read Time: 1 minute(s)
Tags: program control program execution
# Description
The EXIT statement halts the execution of a program and returns a numeric exit code to the parent process.
It takes the general form:
EXIT(expression)
1
or
EXIT
1
where expression must evaluate to a numeric result, which should be the appropriate error code for the environment in which jBASE is being run. The error code is returned to the parent C function exit().
# Note
- For compatibility with older versions of the language, the EXIT statement should be used without an expression. In this case, it is synonymous with the BREAK statement.
- If the expression does not evaluate to a numeric result the program will enter the debugger and display a suitable error message.
- The expression has been forced to be parenthesized to avoid confusion with the EXIT statement without an expression as much as is possible.
Assuming a file has been opened to FileDesc, an example of use is as follows:
READ Record FROM FileDesc, RecordKey
ELSE CRT "Record ":RecordKey:" is missing"
EXIT(1)
END
1
2
3
4
2
3
4
See also: BREAK.
Go back to jBASE BASIC
Go back to Programmers' Reference Guide