<?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="fr" xml:id="then">
    <refnamediv>
        <refname>then</refname>
        <refpurpose>mot-clé dans une structure 'if' et 'select' </refpurpose>
    </refnamediv>
    <refsection>
        <title>Description</title>
        <para>
            Utilisé dans les instructions de contrôle <literal>if</literal> et <literal>select</literal>.
            Chaque mot-clé <literal>then</literal> doit être sur la même ligne que le <literal>if</literal>, <literal>elseif</literal> ou <literal>case</literal> correspondant.
        </para>
        <para>
            Le mot-clé <literal>then</literal> peut être remplacé par un retour à la ligne ou une virgule.
        </para>
    </refsection>
    <refsection>
        <title>Exemples</title>
        <programlisting role="example"><![CDATA[
if 2*2 == 4 then
   disp("Ca marche")
end

n=round(10*rand(1,1))
select n
    case 0 then
        disp(0)
    case 1 then
        disp(1)
    else
      disp(n);
end
        ]]></programlisting>
    </refsection>

    <refsection role="see also">
        <title>Voir aussi</title>
        <simplelist type="inline">
            <member>
                <link linkend="if">if</link>
            </member>
            <member>
                <link linkend="elseif">elseif</link>
            </member>
            <member>
                <link linkend="select">select</link>
            </member>
            <member>
                <link linkend="case">case</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>Historique</title>
        <revhistory>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revdescription>
                  <literal>then</literal> est désormais protégé. Les affectations telles que
                  <literal>then=1</literal> ne sont plus possibles.
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
