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

Home » Public Forums » archive » how to catch a math error?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
how to catch a math error? [message #34805] Thu, 17 April 2003 12:17
J Li is currently offline  J Li
Messages: 1
Registered: April 2003
Junior Member
Hi,

I am trying to figure out how to trap the math error and dump the error
message to a file. Math error is somehow different than other types of
errors? My test program is listed below.

I have done tests for I/O error or raising an exception by issuing a
"message" call. They all work as expected, that is I got error message in
the myLog.err file and the program exited gracefully. So far, I have not
been able to do the same for math error. Please help!

Email: jylimd(at)yahoo(dot)com


pro test3
on_error, 2
print, "i am in test3"
x = 1 / 0
; message, "Error occurs in test 3"
end

pro test2
on_error,2
print, "i am in test2"
test3
end

pro test1
on_error,2
print, "i am in test 1"
test2
end


pro test

Catch, myError
if(myError NE 0) then begin
Catch, /Cancel
openw, lun, "myLog.err", /get_lun
printf,lun, !Error_State.Msg
free_lun, lun
return
endif
test1


end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: integrating ESRI COM Objects
Next Topic: Re: how to catch a math error?

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

Current Time: Wed Oct 08 16:00:22 PDT 2025

Total time taken to generate the page: 0.00528 seconds