1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<?xml version="1.0" encoding="UTF-8"?>
<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" version="5.0-subset Scilab" xml:lang="fr" xml:id="select">
<info>
<pubdate>$LastChangedDate$</pubdate>
</info>
<refnamediv>
<refname>select</refname>
<refpurpose> mot-clé utilisé dans une structure select ... case </refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
Mot-clé utilisé dans une structure <literal>select ... case</literal>, à utiliser de la façon suivante :
</para>
<programlisting role = ""><![CDATA[
select expr,
case expr1 then instructions1,
case expr2 then instructions2,
...
case exprn then instructions,
[else instructions],
end
]]></programlisting>
<para>
Notes :
</para>
<itemizedlist>
<listitem>
<para>La seule contrainte est que chaque mot-clé "then" soit sur la même ligne que le "case" correspondant.</para>
</listitem>
<listitem>
<para>Le mot-clé then peut être remplacé par un passage à la ligne ou une virgule.
Les <literal>instructions1</literal> sont exécutées si <literal>expr1=expr</literal>, etc.
</para>
</listitem>
</itemizedlist>
<para>
Attention : le nombre de caractères constituant le corps d'une instruction conditionnelle (if while for ou select/case) est limité à 16k..
</para>
</refsection>
<refsection>
<title>Exemples</title>
<programlisting role="example"><![CDATA[
while %t do
n=round(10*rand(1,1))
select n
case 0 then
disp(0)
case 1 then
disp(1)
else
break
end
end
]]></programlisting>
</refsection>
<refsection>
<title>Voir Aussi</title>
<simplelist type="inline">
<member>
<link linkend="if">if</link>
</member>
<member>
<link linkend="while">while</link>
</member>
<member>
<link linkend="for">for</link>
</member>
</simplelist>
</refsection>
</refentry>
|