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

Home » Public Forums » archive » Re: Silent errors in run-time
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Silent errors in run-time [message #45823 is a reply to message #45821] Thu, 13 October 2005 03:09 Go to previous messageGo to previous message
otto.hyvarinen is currently offline  otto.hyvarinen
Messages: 3
Registered: October 2005
Junior Member
Thank you for your answers, I didn't get the solution I was looking
for, but at least I discovered a work-around.

This time I try to be more clear: If I have a program like

pro test
openr,1,"nofile"
close,1
end

and run it interactively. I get:

IDL> .compile test
% Compiled module: TEST.
IDL> test
% OPENR: Error opening file. Unit: 1, File: nofile
No such file or directory
% Execution halted at: TEST 2 /home/hyvarine/test.pro
% $MAIN$
IDL>

No suprises here.

If I compile it and then run it like this

IDL> .compile test
% Compiled module: TEST.
IDL> resolve_all
% Compiled module: RESOLVE_ALL.
% Compiled module: PATH_SEP.
% Compiled module: UNIQ.
IDL> save,/routines,filename='test.sav'
IDL>
[hyvarine@rokka somedir]$ idl -rt="test.sav"

I will get a dialog box (by DIALOG_MESSAGE, I think) saying "The
following error was encountered: OPENR: Error opening file. Unit: 1,
File: nofile Please consult the supplier of the application.". My
problem was how to get rid of this box and get the error messages back
to stderr (or stdout). No one seems to know that. But at least now I
know how to change my program to

pro test2
catch, theError
if (theError ne 0) then begin
catch, /cancel
goto, theEnd
endif
openr,1,"nofile"
theEnd:
close,1
end

and this way get rid of the message for all. This is enough for me.

regards,
Otto Hyvärinen
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Format query
Next Topic: Re: declare variables

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

Current Time: Wed Oct 08 17:28:08 PDT 2025

Total time taken to generate the page: 0.00447 seconds