| Re: Why do variables become "undefined" after some error? [message #59530] |
Tue, 01 April 2008 10:45 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
andry_william@hotmail.com writes:
> I would like to ask hwy variables become "undefined" after an error in
> running a program/routine? (If for some reason, I read data into
> memory then run a routine which will process those data, but the
> routine has some error, THEN all my variables become "undefinend"). It
> is annoying since sometimes the data came from a call done much
> earlier in the IDL session.
>
> How can I restore the variables to their data rather than running
> again the routine/command which read them?
Try typing "RETALL" when you crash your program. :-)
Or, put ON_ERROR,1 in your programs and you will return
to the main-level where you data is automatically. You
are in the wrong scope when you crash your program to
see your variables.
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.")
|
|
|
|