<!--
* 
*
*  ProLinga-Doc
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Doc.
*
*  ProLinga-Doc is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Doc is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Doc.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->
<refentry id="cmd_elseif">
  <refmeta>
    <refentrytitle>ELSEIF Command</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>ELSEIF</refname>
    <refpurpose>Test for an alternative condition if previous condition is not met.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>ELSEIF</command>
      <arg choice='plain'><replaceable>dataref</replaceable></arg>
      <arg choice='plain'><replaceable>comparator</replaceable></arg>
      <arg choice='plain'><replaceable>dataref</replaceable></arg>
      <arg rep='repeat' choice='opt'>
      <arg choice='plain'>
        <group choice='req'>
          <arg choice='plain'><option>AND</option></arg>
          <arg choice='plain'><option>OR</option></arg>
        </group>
      </arg>
      <arg choice='plain'><replaceable>dataref</replaceable></arg>
      <arg choice='plain'><replaceable>comparator</replaceable></arg>
      <arg choice='plain'><replaceable>dataref</replaceable></arg>
      </arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="cmd_elseif_introduction">
    <title>Introduction</title>
    <para>
      The <link linkend="cmd_elseif">ELSEIF</link> command executes a logic block 
      if the condition is met and if previous <link linkend="cmd_if">IF</link>
      <link linkend="cmd_elseif">ELSEIF</link> conditions are not met. 
      Structures can be nested.
    </para>
  </refsect1>
  <refsect1 id="cmd_elseif_arguments">
    <title>Arguments</title>
    <variablelist>
      <varlistentry>
	<term><replaceable>data_ref</replaceable></term>
	<listitem>
	  <simpara>
            Valid data reference, string or numeric value.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><replaceable>comparator</replaceable></term>
	<listitem>
	  <simpara>
	  </simpara>
	  <simpara>
            <simpara></simpara>
            <simplelist type='vert' columns='1'>
              <member><![CDATA[=]]></member>
              <member><![CDATA[<]]></member>
              <member><![CDATA[>]]></member>
              <member><![CDATA[<=]]></member>
              <member><![CDATA[>=]]></member>
              <member><![CDATA[<>]]></member>
            </simplelist>
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1 id="cmd_elseif_example">
    <title>Example</title>
<programlisting><![CDATA[
. . .
. . .
IF L-Counter < 10
    CALL ProcessSmallOrder L-OrderNumber
ELSEIF L-Counter = 10
    CALL ProcessMediumOrder L-OrderNumber
ELSEIF L-Counter >= 10
    CALL ProcessLargeOrder L-OrderNumber
ENDIF
. . .
. . .
]]></programlisting>
  </refsect1>

  <refsect1 id="cmd_elseif_related">
    <title>Related Commands</title>
    <para>
      <link linkend="cmd_else">ELSE</link>
      <link linkend="cmd_endif">ENDIF</link>
      <link linkend="cmd_if">IF</link>
    </para>
  </refsect1>

</refentry>

