Re: Function similar to python "try"

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 02 2013 - 14:16:33 MDT

Hi Marston,

I'm afraid there is no such thing as the "try" concept in NCL, but
if you want to test for a valid file, you might try "isfilepresent".

 if(isfilepresent(url+filename)) then
   do something
 else
    print error
  end if

I'm not sure if the "isfilepresent" will work in your case, but it's worth a try.

--Mary

On Aug 1, 2013, at 8:53 AM, Marston Johnston wrote:

> Hi,
>
> I'm looping over many files and some may be corrupted. I'm looking for a way to handle a failure to open in NCL without causing a fatal error.
> In Python, this can be done using:
>
> try:
> command
> except:
> command
>
> Is there something similar in NCL?
>
> /M
>
> --
> Only the fruitful thing is true!
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 2 14:16:43 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 07 2013 - 13:59:00 MDT