Aborts an SPL routine and optionally displays a message.
ERROR("message", "title", guiflag, errval)
"message" |
- |
An optional string. Error message to display. |
||||||
"title" |
- |
An optional string. The title of the message box if a GUI is displayed. |
||||||
guiflag |
- |
Optional. An integer, the display method:
|
||||||
errval |
- |
Optional. An integer. The returned error value used to propagate errors to calling routines. Normally not specified. Defaults to 0. |
Nothing, the SPL routine that invoked the error function terminates processing.
invnum(0)
aborts and displays the message:
invnum - input must be non-zero
sqrt(invnum(0))
aborts and displays the message:
invnum - input must be non-zero
ERROR aborts further SPL processing. As shown in the second example, nested functions or SPL routines also terminate as a result of ERROR.
If guiflag is -1, the flag is set to the configuration parameter SPL_GUI_ERROR.
See SPL Error Handlers for information on handling errors in SPL functions.