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 the 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:
0001 READ Record FROM FileDesc, RecordKey 0002 ELSE CRT "Record ":RecordKey:" is missing" 0003 EXIT(1) 0004 END
See also: BREAK.
Go back to jBASE BASIC.