MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Accumulating error counts?


Try this :

test::failure="Failure !";

f[]:=If[Random[Integer]\[Equal]0,0,Message[test::failure]]

globalCounter=0;
Do[ 
    Check[f[],globalCounter++],{5}];
globalCounter

On Saturday 13 November 2004 10:40, AES/newspost wrote:
> I'd like to turn off certain error messages like
>
>     NIntegrate::ncvb: NIntegrate failed to converge
>     NIntegrate::slwcon: Numerical integration converging too slowly
>
> using Off[], but accumulate a count of the total number of times the
> message occurred in a sequence of calculations.  How do I get at that
> number?
>
> (Better yet, I'd like to know the number of times it could have
> occurred, as well as the number of times it did occur.)


  • Prev by Date: Re: TraditionalForm of expressions WITHOUT evaluating.
  • Next by Date: Re: Challenge: Fastest method to convert positive integers to 1 in a long list
  • Previous by thread: Accumulating error counts?
  • Next by thread: Challenge: Fastest method to convert positive integers to 1 in a long list