The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: OnError [Thread"::"tdlen"]
Replies: 4   Last Post: Apr 23, 2014 4:53 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bob Hanlon

Posts: 906
Registered: 10/29/11
Re: OnError [Thread"::"tdlen"]
Posted: Apr 12, 2014 5:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Check[expr, failexpr] evaluates expr, and returns the result, unless
messages were generated, in which case it evaluates and returns failexpr. "

Bob Hanlon

On Fri, Apr 11, 2014 at 2:12 AM, EMartin <>wrote:

> Hi,
> Many classic programming languages provide a command to interrupt
> computations when some exception arises, allowing to perform any action on
> the exception as in something as, for example:
> OnError [] do (action)] [routine] (*This could be the general pattern*)
> OnError [] do (Print[Stack]; Abort[] ) [routine] (*This could be a more
> specific pattern*)
> OnError [Thread"::"tdlen"] do JumpToCheck ][routine]
> (*The above could be a more specific but even more general pattern. The
> jump
> made to an exception handling routine to evaluate or treat the exception*)
> These catching commands should be located at the beginning of the whole
> code as in *TimeConstrained[routine, time]* which aborts the routine if it
> takes more than time seconds.
> Mathematica has got enough stuff to deal with erroneous situation (Abort,
> Interrupt, Catch, Throw,=85) provided one is able to catch the exception
> (and
> its type) as soon as it arises , but I never was able to do it.
> Since Mathematica prints the errors messages, the type of the exception and
> the exact point where it arises is available (but hidden) to let the user
> to
> take control. Probably the tool is already available but I can find it.
> Any help will be welcome
> E. Martin-Serrano
> __________________________________________
> This e-mail and the documents attached are confidential and intended solely
> for the addressee; it may also be privileged. If you receive this e-mail in
> error, please notify the sender immediately and destroy it. As its
> integrity
> cannot be secured on the Internet, no sender92s liability can be =
> triggered
> for the message content. Although the sender endeavors to maintain a
> computer virus-free network, he/she does not warrant that this
> transmission
> is virus-free and will not be liable for any damages resulting from any
> virus transmitted.
> Este mensaje y los ficheros adjuntos pueden contener
> informaciF3nconfidencial destinada solamente a la(s) persona(s) mencionadas
> anteriormente y su contenido puede estar protegido por secreto profesional
> y
> en cualquier caso el mensaje en su totalidad est=E1 amparado y protegido
> por
> la legislaci=F3n vigente que preserva el secreto de las comunicaciones, y
> por
> la legislaci=F3n de protecci=F3n de datos de car=E1cter personal. Si usted
> recibe
> este correo electr=F3nico por error, gracias por informar inmediatamente
> al
> remitente y destruir el mensaje. Al no estar asegurada la integridad de
> este
> mensaje sobre la red, el remitente no se hace responsable por su contenido.
> Su contenido no constituye ning=FAn compromiso para el remitente, salvo
> ratificaci=F3n escrita por ambas partes. Aunque se esfuerza al m=E1ximo
> por
> mantener su red libre de virus, el emisor no puede garantizar nada al
> respecto y no ser=E1 responsable de cualesquiera da=F1os que puedan
> resultar de
> una transmisi=F3n de virus.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.