JavaScript global method: Quit

Allows JavaScript to abort processing and return a failure return code.

Syntax

Quit( return code );

Arguments

The following arguments are valid for this function:

Argument Data type Required Description
return code Integer Yes This argument contains the numeric return code you want the script to return upon ending.

Return values

A failure return code

Throws

None

Description

This method stops the processing of JavaScript from the point it is called and returns the failure return code specified in the return code argument. Any JavaScript code after the Quit() method is ignored.

Example

This example does the following:

  • Prints a message
  • Quits and returns a failure return code
print( "Testing the Quit() method..." );
Quit( -1 );
print( "You won't see this message because the JavaScript has already quit" );