[ncl-talk] "elif" blocks

Mary Haley haley at ucar.edu
Mon Feb 23 15:12:49 MST 2015


Thomas,

Ekin pointed you to the place in the documentation that talks about the
lack of an "else if" type of command. It's mentioned in the third paragraph.

You can mimic it somewhat, by putting the "else" and the "if" on the same
line, but the caveat is that you need and "end if" for every "else if" that
you introduce:

   if (*scalar_logical_expression*) then
       *statement list*
   else if (*scalar_logical_expression*) then
       statement list
   else if (*scalar_logical_expression*) then
       *statement list*
   else
       *statement list*
   end if
   end if
   end if

We do not have immediate plans to add a formal "elif" type statement,
but we do have a ticket for it. The developers have told me this is
not a trivial request.

--Mary




On Mon, Feb 23, 2015 at 7:33 AM, Thomas Tobian <thomastobian at gmail.com>
wrote:

> I meant elif instead of else if... anyhow, they are doing the same thing.
>
>
> On Mon, Feb 23, 2015 at 3:30 PM, Ekin Akoglu <ekin at ims.metu.edu.tr> wrote:
>
>> Please see
>> https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml
>>
>> Best,
>>
>> Ekin
>>
>> On 23 February 2015 at 15:26, Thomas Tobian <thomastobian at gmail.com>
>> wrote:
>>
>>> Hi NCL,
>>>
>>> is "elif" statement valid in NCL?
>>>
>>> Thomas Tobian
>>>
>>> _______________________________________________
>>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150223/edad025f/attachment.html 


More information about the ncl-talk mailing list