| getErrorLimit |
() |
yoix.system |
| |
Returns the interpreter's error limit, which is a threshold that is
initially disabled because it starts at
0,
but it can be reset using
setErrorLimit.
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,
setErrorCount,
setErrorLimit,
traceInstructions,
traceMethodCalls
|
|
Yoix is a registered trademark of AT&T Inc.
|