Another Call_Procedure Surprise [message #74631] |
Wed, 26 January 2011 09:58 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I had another Call_Procedure surprise this morning. (You
recall that Call_Procedure doesn't flush the graphics
pipeline on UNIX machines, discovered last week.) This
morning I learned it is impossible to catch errors
generated when Call_Procedure fails. In fact, there
is no way to *determine* if Call_Procedure has failed!
I had to cobble something together in my FSC_Window
program. (I've been working on improved error handling
and messages this morning.) What I do in the module
that uses Call_Procedure is assume failure. (Always
a pretty safe bet!) Then I reset the !Error_State system
variable before I use Call_Procedure.
success = 0
Message, /RESET
Call_Procedure, ....
If an error occurs, the !Error_State.MSG field will be
set to the error message. If it is still a null string,
I probably executed the command successully, so I can
change my success flag.
IF !Error_State.MSG EQ "" THEN success = 1
I'll make some notes about this when I get a few spare
minutes, but I thought it was worth mentioning.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|