focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / errcount
1 NAME
2     errcount - return or set the internal error count
3
4 SYNOPSIS
5     errcount([num])
6
7 TYPES
8     num         integer
9
10     return      integer
11
12 DESCRIPTION
13     An internal variable keeps count of the number of functions
14     evaluating to an error value either internally or by a call to
15     error() or newerror().
16
17     The errcount() with no args returns the current error count.  Calling
18     errcount(num) returns the current error count and resets it to num.
19
20     If the count exceeds the current value of errmax, execution is aborted
21     with a message displaying the errno for the error.
22
23     If an error value is assigned to a variable as in:
24
25                         infty = 1/0;
26
27     then a function returning that variable does not contribute to
28     errcount.
29
30 EXAMPLE
31     > errmax(10)
32             0
33     > errcount()
34             0
35     > a = 1/0; b = 2 + ""; c = error(27); d = newerror("a");
36     > print errcount(), a, errcount(), errmax();
37     4 Error 10001 4 10
38
39 LIMITS
40     0 <= num < 2^32
41
42 LINK LIBRARY
43     none
44
45 SEE ALSO
46     errmax, error, strerror, iserror, errno, newerror, errorcodes
47