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

Home » Public Forums » archive » Re: on_ioerror?
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: on_ioerror? [message #11891 is a reply to message #11883] Wed, 03 June 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Dallas Masters (dallas@lanl.gov) writes:

> I'm running read_gif and read_tiff in a loop.
> If an I/O error occurs, I want to print an error message
> and continue going through the loop. Given read_gif
> and read_tiff, how would this be done (I've tried, nothing
> works yet). Thanks.

I just looked at the code for these two routines and both
return to the caller of the program when an error occurs
(ON_ERROR, 2). I should think a simple CATCH in the routine
that called either one of these programs would catch
errors. Then you could proceed in whatever manner seemed
appropriate.

Your code might look like this:

Catch, error
IF error NE 0 THEN BEGIN
Print, !Err_String
CASE loopFlag OF
1: GOTO, GIF_LOOP
2: GOTO, TIFF_LOOP
ENDCASE
ENDIF

loopFlag = 1
GIF_LOOP:
FOR j=0,n, DO READ_GIF, ....

loopFlag = 2
TIFF_LOOP:
for j=0, n DO READ_TIFF, ...

This is pseudo code, of course. :-)

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: warning: (all(part1))(part2) = part2*0.
Next Topic: Re: subpixel image movement by bicubic interpolation?

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

Current Time: Sun Nov 30 22:42:58 PST 2025

Total time taken to generate the page: 0.40394 seconds