Exit and Exit Status

The exit statement is used to terminate the program and classify the input.

Table of Contents
  1. Exit
    1. Exit - Definition and Usage
    2. Exit - Syntax
    3. Exit - Fields
    4. Exit - More Examples
  2. Exit Status
    1. Exit Status - List

Exit

Reject the input if the first pixel is white:

if white exit 1

Exit - Definition and Usage

The exit function terminates the program.

Exit - Syntax

exit [status]

Exit - Fields

Field Description
exit Required. exit.
status Optional. An exit status, default 0.

Exit - More Examples

Else is not treated as an exit status:

if color exit else right
if white exit 1

Exit Status

The exit status classifies the input, see the list below:

Exit Status - List

Exit Status Description
0 The input is accepted (the program finished).
1 The input is rejected.
2 The input is malformed (the program moved off the canvas).