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 72 73 74 75 76 77
|
<?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="en" xml:id="while">
<info>
<pubdate>$LastChangedDate: 2006-09-10 20:58:00 +0200 (dim, 10 sep 2006)$</pubdate>
</info>
<refnamediv>
<refname>while</refname>
<refpurpose> while keyword</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para><literal>while</literal> clause. Must be terminated by
<literal>"end"</literal></para>
<para>
<literal>while expr ,instructions,...[,else instructions], end</literal>
</para>
<para>
<literal>while expr do instructions,...[,else instructions], end</literal>
</para>
<para>
<literal>while expr then instructions,...[,else instructions], end</literal>
</para>
<para>Notes:</para>
<itemizedlist>
<listitem>
<para> The only constraint is that each <literal>then</literal> or
<literal>dod</literal>" keyword must be on the same line line as
<literal>while</literal> keyword.</para>
</listitem>
<listitem>
<para>Keywords <literal>then</literal> or <literal>do</literal> can
be replaced by a carriage return or a comma. For compatibility
with Matlab it is also possible, but not recommended, to put a
space between the end of the expression and the beginning of
the first instruction. </para>
</listitem>
<listitem>
<para>
The optional <literal>,else instructions</literal> construction
allows to gives instructions which are executed when expr
expression becomes false.</para>
</listitem>
</itemizedlist>
<para>
Warning: the number of characters used to define the body of any
conditionnal instruction (if while for or select/case) must be
limited to 16k.</para>
</refsection>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
e=1; a=1; k=1;
while norm(a-(a+e),1) > %eps, e=e/2; k=k+1; end
e,k
]]></programlisting>
</refsection>
<refsection>
<title>See Also</title>
<simplelist type="inline">
<member>
<link linkend="for">for</link>
</member>
<member>
<link linkend="select">select</link>
</member>
<member>
<link linkend="break">break</link>
</member>
<member>
<link linkend="return">return</link>
</member>
<member>
<link linkend="pause">pause</link>
</member>
</simplelist>
</refsection>
</refentry>
|