AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
getErrorCount () yoix.system
 
Returns the number of errors that have occurred since the interpreter started or since the counter was explicitly reset using setErrorCount. Whenever an error occurs the interpreter increments an internal counter and quits when an error limit has been set to a positive number using setErrorLimit 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, setErrorLimit, traceInstructions, traceMethodCalls

 

Yoix is a registered trademark of AT&T Inc.