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

Home » Public Forums » archive » skip the corrupted hdf file and continue the for lood for uncorrupted hdfs
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: skip the corrupted hdf file and continue the for lood for uncorrupted hdfs [message #87371 is a reply to message #87355] Tue, 28 January 2014 09:52 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Tuesday, 28 January 2014 06:14:03 UTC+1, Brent Fallarcuna wrote:
> On Monday, January 27, 2014 4:22:26 PM UTC+8, Brent Fallarcuna wrote:

> Hello.
>
> I've run this code, wherein I inserted the for loop. The output on the command line says "MOD17A2.A2000065.h29v07.005.2010162162935.hdf
>
> Attempt to subscript FILENAME with K is out of range." and it only prints a single value.

Well. This is a rather accurate error message, because this is exactly what is going on. You (or actually I since you copied my code verbatim) made an error within the error handler. The value to print in the error handler is FILENAME or FILELIST[i], not FILENAME[i]. Of course, in your case, you most likely would like to save the name of the erroneous file in the error handler instead of just printing the name.

> catch, error
> if error ne 0 then begin
> print, filename[i] <------------ ERROR IN ERROR HANDLER
> print, !error_state.msg
> ;continue with next item in loop if error was encountered
> catch, /cancel
> continue
> endif
>
> ;access hdf file
> hdf_id = hdf_sd_start(filename[k]) <--------- ANOTHER ERROR
> catch, /cancel
>
> ;Do other stuff with file here if no error was encountered.

Also, I have no idea what you are trying to do with the double loop.

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Instances of structure array with varying no. of elements
Next Topic: How can I change from qwerty keyboard to azerty ?

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

Current Time: Sat Oct 11 09:46:41 PDT 2025

Total time taken to generate the page: 0.64210 seconds