Files
calc/help/error
2017-05-21 15:38:36 -07:00

42 lines
814 B
Plaintext

NAME
error - generate a value of specified error type
SYNOPSIS
error([n])
TYPES
n integer, 0 <= n <= 32767; defaults to errno()
return null value or error value
DESCRIPTION
If n is zero, error(n) returns the null value.
For positive n, error(n) returns a value of error type n.
error(n) sets calc_errno to n so that until another error-value
is returned by some function, errno() will return the value n.
EXAMPLE
Note that by default, errmax() is 0 so unless errmax() is
increased you will get:
> ba = error(10009)
Error 10009 caused errcount to exceed errmax
> errmax(errcount()+1)
0
> a = error(10009)
> a
Error 10009
LIMITS
none
LIBRARY
none
SEE ALSO
errcount, errmax, errorcodes, iserror, errno, strerror, newerror