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

Home » Public Forums » archive » Re: IDL 8.0 bug -- line number of errors not given
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: IDL 8.0 bug -- line number of errors not given [message #72886 is a reply to message #72885] Tue, 12 October 2010 21:55 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Oct 12, 11:42 pm, wlandsman <wlands...@gmail.com> wrote:
> But if I use CATCH I need to add a whole paragraph somewhere (where?)
> in the code
>
>    Catch, theError
>    IF theError NE 0 THEN BEGIN
>        Catch, /Cancel
>        void = Error_Message()
>        RETURN
>    END
>
> So what are the advantages of using CATCH?    (This is not a trick
> question -- I've had a mental block about how to use CATCH.)  --Wayne

To just throw an error message and return, not many advantages indeed:
One is having only one place to send a common error message, instead
of several tests, all with the same argument to message. Another is
not stopping execution, like David mentioned.

But I find that the main use of catch is to handle the errors, not
just send error messages. It can be part of the approach of 'asking
for forgiveness' (handling the errors) instead of 'asking for
permission' (testing to avoid errors). Sometimes it is much easier to
rely on an error occurring (and handling it) than to test for many
potentially complicated possibilities.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: execute an idl procedure without seeing idl workbench
Next Topic: convenient graphical object syntax

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

Current Time: Wed Oct 08 19:53:44 PDT 2025

Total time taken to generate the page: 0.00435 seconds