Initial revision
[LeanCalc.git] / help / strerror
1 NAME
2     strerror - returns a string describing an error value
3
4 SYNOPSIS
5     strerror([x])
6
7 TYPES
8     x           error-value or integer in [0, 32767], defaults to errno()
9
10     return      string
11
12 DESCRIPTION
13     If x is the error-value with index n, strerror(x) and strerror(n)
14     return one of:
15
16                 a system-generated message,
17                 a calc-generated description,
18                 a user-defined description created by newerror(str),
19                 the string "Error n",
20
21     where, in the last form, n is represented decimally.
22
23 EXAMPLE
24     System error messages may be different for different systems.
25     > errmax(errcount()+3)
26             0
27     > strerror(2)
28         "No such file or directory"
29
30     > x = 3 * ("a" + "b")
31     > print strerror(x)
32     Bad arguments for +
33
34     > a = newerror("alpha")
35     > print strerror(a)
36     alpha
37
38     > print strerror(999)
39     Error 999
40
41     > a = 1/0
42     > print strerror()
43     Division by zero
44
45 LIMITS
46     none
47
48 LINK LIBRARY
49     none
50
51 SEE ALSO
52     errcount, errmax, error, iserror, errno, newerror, errorcodes
53