how to clear error message [message #73291] |
Wed, 03 November 2010 13:58  |
Truong Le
Messages: 42 Registered: September 2010
|
Member |
|
|
All,
I need to know how to clear all error message that idl generated.
I am using this two lines to stop to trap my error.
Help, /Last_Message, Output=theErrorMessage
errorLength = N_ELEMENTS(theErrorMessage)
However, I need to clear all the error message so that when I am
looping to these two lines again the
errorLength should be zero when no error message occur.
Thanks
|
|
|
Re: how to clear error message [message #73401 is a reply to message #73291] |
Thu, 04 November 2010 09:20  |
Truong Le
Messages: 42 Registered: September 2010
|
Member |
|
|
On Nov 4, 9:53 am, Paul van Delst <paul.vande...@noaa.gov> wrote:
> Truong Le wrote:
>> On Nov 3, 5:26 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
>>> What about trying a catch error handler? Something like this:
>
>>> pro blah
>>> CATCH, error_status
>>> IF ( error_status NE 0 ) THEN BEGIN
>>> CATCH, /CANCEL
>>> MESSAGE, !ERROR_STATE.MSG, /CONTINUE
>>> RETURN
>>> ENDIF
>
>>> ....do other stuff....
>
>>> end
>
>>> If an error occurs in the "....do other stuff...." section, the error message will get printed out control will return
>>> to the caller.
>
>>> You can throw your own errors in the "....do other stuff...." section by doing something like
>
>>> IF ( ...an error condition is detected... ) THEN $
>>> MESSAGE, 'this is my own error message', /NONAME, /NOPRINT
>
>>> when you detect an error in your own code.
>
>>> cheers,
>
>>> paulv
>
>>> Truong Le wrote:
>>>> All,
>>>> I need to know how to clear all error message that idl generated.
>>>> I am using this two lines to stop to trap my error.
>>>> Help, /Last_Message, Output=theErrorMessage
>>>> errorLength = N_ELEMENTS(theErrorMessage)
>>>> However, I need to clear all the error message so that when I am
>>>> looping to these two lines again the
>>>> errorLength should be zero when no error message occur.
>>>> Thanks
>
>> I did that but it didn't work.
>
> I tried that and it did work.
>
> cheers,
>
> paulv
i try that too and it didn't work because the "Warning" message is
looping within the mrd_hread.
I might have to try modify the mrd_hread procedure as you have
suggested.
procedure
|
|
|
Re: how to clear error message [message #73402 is a reply to message #73291] |
Thu, 04 November 2010 09:20  |
Truong Le
Messages: 42 Registered: September 2010
|
Member |
|
|
On Nov 4, 9:53 am, Paul van Delst <paul.vande...@noaa.gov> wrote:
> Truong Le wrote:
>> On Nov 3, 5:26 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
>>> What about trying a catch error handler? Something like this:
>
>>> pro blah
>>> CATCH, error_status
>>> IF ( error_status NE 0 ) THEN BEGIN
>>> CATCH, /CANCEL
>>> MESSAGE, !ERROR_STATE.MSG, /CONTINUE
>>> RETURN
>>> ENDIF
>
>>> ....do other stuff....
>
>>> end
>
>>> If an error occurs in the "....do other stuff...." section, the error message will get printed out control will return
>>> to the caller.
>
>>> You can throw your own errors in the "....do other stuff...." section by doing something like
>
>>> IF ( ...an error condition is detected... ) THEN $
>>> MESSAGE, 'this is my own error message', /NONAME, /NOPRINT
>
>>> when you detect an error in your own code.
>
>>> cheers,
>
>>> paulv
>
>>> Truong Le wrote:
>>>> All,
>>>> I need to know how to clear all error message that idl generated.
>>>> I am using this two lines to stop to trap my error.
>>>> Help, /Last_Message, Output=theErrorMessage
>>>> errorLength = N_ELEMENTS(theErrorMessage)
>>>> However, I need to clear all the error message so that when I am
>>>> looping to these two lines again the
>>>> errorLength should be zero when no error message occur.
>>>> Thanks
>
>> I did that but it didn't work.
>
> I tried that and it did work.
>
> cheers,
>
> paulv
i try that too and it didn't work because the "Warning" message is
looping within the mrd_hread.
I might have to try modify the mrd_hread procedure as you have
suggested.
procedure
|
|
|