error(
error(
MESSAGE
)

The error( function returns an error with the specified message.

Parameters

This function has one parameter:

message – The error message to return.

Description

This function generates an error. It is usually used with the ?( or switch( functions, like this:

    ?(Price>0,Price,error("Negative or zero price is not allowed"))

Note that this function is not generating a text value, it is generating an error. This means, for example, that in this case a negative price would stop a procedure that contained this formula (unless the procedure used error trapping).

See Also

- ?( -- allows a formula to make a true/false, yes/no decision.
- catcherror( -- evaluates an expression, but suppresses any error generated by that expression.
- Error Handling -- Techniques for trapping runtime errors instead of letting them abort the program.
- Error Wizard -- Advanced dialog for displaying program errors.
- errortext( -- evaluates an expression, but returns only the error message generated (if any).
- executecatcherrors -- is the same as the execute statement, except for the fact that if an error occurs while running, it can be trapped by an if error statement immediately following the executecatcherrors statement.
- info("error") -- returns the most recent error message.
- info("errorparameter") -- returns the parameter that caused a runtime error.
- info("errorstack") -- returns the contents of the procedure stack after an error.
- info("errorstatement") -- returns the name of the statement that Panorama was trying to run at the time an error occurred.
- onerror -- can be used to catch all errors that are not trapped by if error or try statements.
- onfailedresume -- is used to setup a semi-graceful recovery if a resume statement fails because there was no pause statement.
- returnerror -- passes an error back to the current subroutines calling procedure.
- seterror -- changes the error message returned by info("error").
- switch( -- chooses from a list of values.
- throwerror -- causes an immediate error.

History

Version | Status | Notes
10.0 | New | New in this version