Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Exit

Built-in

SYNTAX

Exit [status] [If expression]

DESCRIPTION

The Exit command terminates execution of the current script if expression evaluates to nonzero (that is, true). If you omit If expression, the script exits unconditionally. When used in this manner outside a script (for instance, in the Worksheet), the MPW Shell terminates execution of previously entered commands.

INPUT

None

OUTPUT

None

STATUS

Exit can return the following status codes:

status

status code specified by the status parameter

n

status code returned by the last command executed

-3

status code if Exit is passed a negative value

-5

invalid expression

PARAMETERS

expression

Specifies an expression.

status

Specifies by number the status value Exit returns. Normally Exit returns the status code of the last command executed. In the case of an invalid expression, it returns -5. The value of status must be greater than or equal to 0.

OPTIONS

None

EXAMPLES

As the last line of a script, this Exit command returns as a status the last value of the variable {ExitStatus}.

Exit {ExitStatus}

SEE ALSO

Evaluate, for more information on expressions

Appendix C, for a list of expression operators

 
 


Last Updated July 2000