<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->

<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="elseif">

    <refnamediv>

        <refname>elseif</refname>

        <refpurpose>if-then-elseのキーワード</refpurpose>

    </refnamediv>

    <refsection>

        <title>説明</title>

        <para>

            条件が複数ある場合,キーワード<literal>elseif</literal>

            が便利です.

            複数の<literal>elseif</literal>がある場合,

            最初にtrue条件となったものが選択されます(他のものがtrueの場合でも).

        </para>

    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
a=1;
if a==1 then
    disp("a equals 1")
elseif a==2 then
    disp("a equals 2")
elseif a==1 & a>0 then
    disp("this condition is true, but never will be selected, because it is the second true condition.")
else
    disp("Case not handled.")
end
     ]]></programlisting>

    </refsection>

    <refsection role="see also">

        <title>参照</title>

        <simplelist type="inline">

            <member>

                <link linkend="if">if</link>

            </member>

            <member>

                <link linkend="select">select</link>

            </member>

        </simplelist>

    </refsection>
    <refsection role="history">
        <title>履歴</title>
        <revhistory>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revdescription>
                  <literal>elseif</literal> is now protected:
                  Assignments like <literal>elseif=1</literal> are no longer possible.
                </revdescription>
            </revision>
        </revhistory>
    </refsection>

</refentry>

