X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10 Apr 2015 12:11 PM by  Zachary Norman
How to suppress error messages
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Zachary Norman



Basic Member


Posts:173
Basic Member


--
10 Apr 2015 12:11 PM
    Hi, I am wondering if there is a way to suppress error messages that IDL displays?

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    10 Apr 2015 12:15 PM
    You can suppress informational messages using !quiet, suppress math errors using !except, and error messages using catch. You can set the environment variable !quiet = 1 which will suppress all informational messages from IDL. It is important to remember that this only stops informational messages from appearing, not error messages. It would be best to include a line that returns !quiet = 0 at the end of your program if you do change the value. However f you suppress informational messages, and you still get an error, IDL will halt the execution of your program and spit out the error. To catch errors, an example using catch is shown below as well as a link to controlling and recovering from errors. http://www.exelisvis.com/...ng_and_Recoveri.html PRO test_catch Catch, errorStatus IF (errorStatus ne 0) then begin ;a=10 MESSAGE, /RESET GOTO, CONT ENDIF ;print the value of a before it is defined ;this makes an error which is found by catch PRINT, a CONT: PRINT, 'done' END
    You are not authorized to post a reply.