mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.10.3t5.45
This commit is contained in:
@@ -2,29 +2,46 @@ NAME
|
||||
strerror - returns a string describing an error value
|
||||
|
||||
SYNOPSIS
|
||||
strerror(x)
|
||||
strerror([x])
|
||||
|
||||
TYPES
|
||||
x error-value or non-negative integer
|
||||
x error-value or integer in [0, 32767], defaults to errno()
|
||||
|
||||
return string or error-value
|
||||
return string
|
||||
|
||||
DESCRIPTION
|
||||
If x is an error-value, strerror(x) returns a string describing that value.
|
||||
If x is the error-value with index n, strerror(x) and strerror(n)
|
||||
return one of:
|
||||
|
||||
If x is an integer within the ranges for system, builtin, and user
|
||||
defined error codes, the string describing error(x) is returned.
|
||||
For integers outside these ranges, an "index out of range for
|
||||
strerror" error is returned.
|
||||
a system-generated message,
|
||||
a calc-generated description,
|
||||
a user-defined description created by newerror(str),
|
||||
the string "Error n",
|
||||
|
||||
where, in the last form, n is represented decimally.
|
||||
|
||||
EXAMPLE
|
||||
> strerror(7)
|
||||
"Bad argument for unary -"
|
||||
System error messages may be different for different systems.
|
||||
> errmax(errcount()+3)
|
||||
0
|
||||
> strerror(2)
|
||||
"No such file or directory"
|
||||
|
||||
> x = 3 * ("a" + "b")
|
||||
> print strerror(x)
|
||||
Bad arguments for +
|
||||
|
||||
> a = newerror("alpha")
|
||||
> print strerror(a)
|
||||
alpha
|
||||
|
||||
> print strerror(999)
|
||||
Error 999
|
||||
|
||||
> a = 1/0
|
||||
> print strerror()
|
||||
Division by zero
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
@@ -32,4 +49,4 @@ LIBRARY
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
error, iserror, errno
|
||||
errcount, errmax, error, iserror, errno, newerror, errorcodes
|
||||
|
Reference in New Issue
Block a user