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

Home » Public Forums » archive » CATCH inside a FOR loop and out?
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: CATCH inside a FOR loop and out? [message #88359 is a reply to message #88337] Wed, 16 April 2014 12:50 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, April 15, 2014 3:31:19 PM UTC-4, Chris Torrence wrote:
> One important point - "catch" is expensive. It's better to put it outside of the for loop, and just use a "start" index to continue. Something like:

Hey Chris, is there any chance of making IDL exception handling more modern? The C language 'setjmp' exception handling model is not the best. The catch variable is kind of a clunky nuisance, and having to remember to /CANCEL your catch handler is also a bit of a chore.

A revised grammar could be as simple as this,

CATCH BEGIN
;; ... possibly failing code ...
END ELSE BEGIN
;; ... exception handler here ...
ENDELSE

No extra keywords required to be added to the language, no nuisance variables, and cleaner flow. (and no backward compatibility problems) The exception handler can look at any of the crumpteen million !ERR* variables to decide what went wrong.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DLM "unload"?
Next Topic: traces plot outside of x-axis boundaries

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

Current Time: Wed Oct 08 18:12:28 PDT 2025

Total time taken to generate the page: 0.00434 seconds