aboutsummaryrefslogtreecommitdiff
path: root/pkg/language/doc/error.hlp
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/language/doc/error.hlp
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/language/doc/error.hlp')
-rw-r--r--pkg/language/doc/error.hlp40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkg/language/doc/error.hlp b/pkg/language/doc/error.hlp
new file mode 100644
index 00000000..9a312de1
--- /dev/null
+++ b/pkg/language/doc/error.hlp
@@ -0,0 +1,40 @@
+.help error Feb86 language
+.ih
+NAME
+error -- abort a task
+.ih
+USAGE
+error errcode errmsg
+.ih
+PARAMETERS
+.ls errcode
+An integer code identifying the error (not used at present in the CL since
+error handlers are not supported).
+.le
+.ls errmsg
+A string describing the error.
+.le
+.ih
+DESCRIPTION
+\fIError\fR may be used to force an error exit from a script.
+The error message will be displayed, and control will return to the
+most recent interactive cl.
+.ih
+EXAMPLES
+1. Abort the current task if there is an attempt to compute a negative
+square root.
+
+.nf
+ if (x < 0)
+ error (1, "sqrt of a negative number (x=" // x // ")")
+ else
+ y = sqrt (x)
+.fi
+.ih
+BUGS
+There is currently no way to post an error handler to receive control
+if \fIerror\fR is called.
+.ih
+SEE ALSO
+cl, bye, logout
+.endhelp