[ncl-talk] Set 10 variables at once to true? - on one line?

Rick Brownrigg brownrig at ucar.edu
Wed May 6 10:04:25 MDT 2015


Hi Erik,

No, I don't believe the language supports multi-var assignment in the
fashion you are wanting, nor is there an end-of-line delimiter (other than
newline).

You could of course do something like:

   res = new((/ 10 /), logical, True)

HTH....
Rick


On Wed, May 6, 2015 at 8:33 AM, Erik Jan Schaffernicht <
eschaffe at uni-koeln.de> wrote:

> I use ten resources variables. At the beginning of my script I have to set
> them one by one to "true".  That is ten lines of code without much
> interesting information.   Is there a better/shorter way to do this?  Eg.
> on one line?
> It is not only about these, furthermore, I have to define some arrays
> later on where I repeat a similar non-informative code as well over several
> lines.
>
> And a separating character to write more than one command per line does
> not exist, right?
>
>
> My actual code:
> Res1=true
> Res2=true
> ...
> Res10=true
>
> Looking for sthg like:
> [ Res1, Res2, ..., Res10 ] = true
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150506/90b8daa3/attachment.html 


More information about the ncl-talk mailing list