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

Home » Public Forums » archive » error handling
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: error handling [message #63447 is a reply to message #1347] Mon, 10 November 2008 09:23 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
bulrushmower@gmail.com schrieb:
> On Nov 10, 7:38 am, David Fanning <n...@dfanning.com> wrote:
>> Spon writes:
>>> bulrushmo...@gmail.com writes:
>>>> How can I set up that when error happens, IDL output the error message
>>>> to log file, then igonore that step continue to process next data?.
>>> Something like this:
>>> OpenW, lun, 'logfile.out', /GET_LUN
>>> FOR j=0,n DO BEGIN
>>> Catch, theError
>>> IF theError NE 0 THEN BEGIN
>>> PrintF, lun, 'Problem with processing step ' + StrTrim(j)
>>> CONTINUE
>>> ENDIF
>>> DoSomeProcessing, data[j]
>>> ENDFOR
>>> Catch, /Cancel
>>> Free_Lun, lun
>>> Excuse my ignorance on this, but wouldn't you need to stick your
>>> "Catch, /Cancel" INSIDE the for loop?
>>> If not, why not?
>> There is no requirement for when you cancel a CATCH, except
>> you should cancel it when you are finished with it. While CATCH
>> is in effect, any error is re-routed to the first line after
>> the CATCH statement. When cancelled, any error is routed
>> to the ON_ERROR condition in effect for that program
>> module. In a real code example, rather than cancelling
>> the CATCH there, I would probably have had another CATCH
>> statement to replace the one I was using for the process
>> loop.
>>
>> 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.")- Hide quoted text -
>>
>> - Show quoted text -
>
> The problem is even I use these statements, program still halted when
> enounter a bad data.
> Should I place the Catch, /cancel inside the loop.
> Another issue, should I state the Catch, the error right after the
> beginning the loop, or after the image processing, end of the loop?
>
> thanks

If you can show your source, e.g. use a pastebin
we usually can better help

cheers
Reimar
[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
Previous Topic: Plot: idl_guide4 UK_NCAS-Meteo-Library
Next Topic: Re: Empty arrays?

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

Current Time: Fri Oct 10 05:22:43 PDT 2025

Total time taken to generate the page: 0.32076 seconds