Re: isdefined gives warning if undefined ?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 31 Aug 2006 22:20:54 -0600 (MDT)

> In a loop, I'm trying to specify the plot Y min/max for certain
> variables and allow the min/max of others to be automatically chosen
> for others. My understanding is that doing so requires trYmin and
> trYmax to be defined and undefined for the two different cases. (The
> documenation actually says that the attributes should not be
> "specified", which I assume means undefined.) But when I try using
> if( isdefined(xyres_at_trYMinF) ) then
> undef(xyres_at_trYMinF)
> end if
> I get the message
> "warning:Attempt to reference attribute (trYMinF) which is undefined"
> from the if test when xyres_at_trYMinF is undefined (duh). Why does it
> give a warning when the whole idea is to find out whether the
> variable is defined or not !?
> _______________________________________________
>
"isdefined"ecks for a keyword, variable, or function/procedure name.

You are checking for an attribute of the variable xyres.
You should use:

      if (isatt(xyres,"trYMinF")) then
          delete(xyres_at_trYMinF)
      end if
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 31 2006 - 22:20:54 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 01 2006 - 09:10:57 MDT