Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?



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.

Was this article helpful?