Updated: 11/30/2021, 7:00:45 PM
Created: 11/30/2021, 7:00:45 PM
Last Updated By: Jake Tuttle
Read Time: 1 minute(s)
Tags: program control program execution
The EXIT statement halts the execution of a program and returns a numeric exit code to the parent process.
It takes the general form:
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().
- 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
See also: BREAK.
Go back to jBASE BASIC
Go back to Programmers' Reference Guide