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 #72669 is a reply to message #72668] Tue, 28 September 2010 14:57 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 9/28/10 3:28 PM, Paul van Delst wrote:
> Hello,
>
> I use CATCH error handling in just about all of my IDL procedures/functions.
>
> If no error occurs, do I need a
> CATCH, /CANCEL
> at the end of the pro/func? Or does exiting the pro/func cancel the error handling that was established on entry
> automatically?
>
> The documentation doesn't explicit state what happens, although the example does *not* have a "CATCH,/CANCEL" before the
> END (I also recall reading a post on this newsgroup stating that it was not necessary to CANCEL and error handler for
> normal termination).

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.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[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 03:39:20 PST 2025

Total time taken to generate the page: 0.63978 seconds