[Thread Prev][Thread Next][Index]

Re: WHILE loop



On Tue, 17 Jun 2003, Mick Spillane wrote:
> It is possible that wiser (though probably not older) heads will come up
> with a way to use "while ... endw" in which case I'll be glad to stand
> corrected.

To the Ferret developers: it'd be great to have a looping structure that
could use an arbitrary counting variable.  Currently, REPEAT requires one
of the four (i,j,k,l) indices, which can be problematic when you have
multiple nested loops or a 4-dimensional dataset (since these indices
affect the context, or dataslice).  It also complicates the writing of
general .jnl scripts that may not know the shape of the input data they'll
be working on.

For back-compatibility, Ferret could keep the current behavior for i,j,k,l
-- but arbitrary counters could add the ability to loop over negative
values, without affecting the current dataslice.  Something like this:

   REPEAT/foo=1:5 (REPEAT/bar=100:-100:-50 (...))

Thank you,

Andrew

+--------------------------------------------------------+
|   Dr. Andrew T. Wittenberg   |        GFDL/NOAA        |
|  Andrew.Wittenberg@noaa.gov  |      Princeton, NJ      |
+--------------------------------------------------------+




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement