failure Function |
The failure function terminates current execution and prints a message to the output window.
failure(expr);
expr | Required. A failure expression to output |
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.
IF length($args) < 4 failure("Usage: import.alchemy <Name> <Copyright> <Country>");
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. |