comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Simple question regarding CATCH,/CANCEL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Simple question regarding CATCH,/CANCEL [message #72668 is a reply to message #72667] Tue, 28 September 2010 15:18 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mgalloy writes:

> In my experience, typical use of CATCH, /CANCEL is like:
>
> catch, error
> if (error ne 0L) then begin
> catch, /cancel
> ... handle error ..
> endif
>
> The CATCH, /CANCEL is used to turn off CATCH-ing errors in the "...
> handle error ..." part -- this would cause a recursive loop in the error
> handling code if an error was encountered in the error handling code itself.

Outside of debugging code, this is about the only way I
ever use it, too.

I could see using it inside a function that had an
ON_ERROR, 2 condition that I wanted to temporarily
override to catch an anticipated error in the function.
When I got past the danger spot I might cancel the
Catch so that the normal RETURN from the function was
in effect.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Simple question regarding CATCH,/CANCEL
Next Topic: mgunit rocks!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 04:30:24 PST 2025

Total time taken to generate the page: 0.72631 seconds