NCL Website header
NCL Home > Documentation > Language

If Statements

   if (scalar_logical_expression) then
       statement list
   end if

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

There's no official "else if", but you can combine "if" and "else" on the same line, as long as you have an "end if" for each one:

   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