Click or drag to resize

failure Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
failure Function

The failure function terminates current execution and prints a message to the output window.

Syntax

Alchemy
failure(expr);

Nomenclature

exprRequired. A failure expression to output

Example

Suppose that a script required three arguments: a name, a copyright message and a country name for the build file.

The following example would provide a usage message and terminate the script if the three arguments were not provided.

Alchemy
IF length($args) < 4
failure("Usage: import.alchemy <Name> <Copyright> <Country>");
Tip Tip

Each Alchemy script is passed an array ($args) which contains any command-line arguments that were passed to the Alchemy script. The first element of the argument array will be the location of the script file.