| setErrorLimit |
(int limit) |
yoix.system |
| |
Sets the interpreter's internal error limit to
limit,
which should be a non-negative number, and returns the old limit.
Whenever an error occurs the interpreter increments an internal counter
and quits when the error limit is positive and the number of errors
equals or exceeds that limit.
A zero error limit, which is the default starting value,
tells the interpreter to keep trying no matter how many errors occur.
| |
| Example: |
The program,
import yoix.stdio.*;
import yoix.system.*;
fprintf(stderr, "limit=%d\n", getErrorLimit());
setErrorLimit(2);
fprintf(stderr, "limit=%d\n", getErrorLimit());
fprintf(stderr, "count=%d\n", getErrorCount());
x;
fprintf(stderr, "count=%d\n", getErrorCount());
x;
fprintf(stderr, "count=%d\n", getErrorCount());
prints,
limit=0
limit=2
count=0
Error: undefined; Name: x; Line: 8; Source: -stdin-
count=1
Error: undefined; Name: x; Line: 10; Source: -stdin-
FatalError: errorlimit; Count: 2
on standard error.
The interpreter quits after the second error, so the last statement
is never executed.
| | |
| Return: |
int
| | |
| See Also: |
dumpJavaStack,
dumpStack,
dumpYoixStack,
getErrorCount,
getErrorLimit,
setErrorCount,
traceInstructions,
traceMethodCalls
|
|
Yoix is a registered trademark of AT&T Inc.
|