mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
Migrate to DocumentationMarkup elements GitOrigin-RevId: ea4d71638b1dd3a160521e655fd2a1670ea27701
19 lines
2.1 KiB
HTML
19 lines
2.1 KiB
HTML
<html><body><div class="content"><div class="section" id="the-while-statement">
|
|
<span id="while"></span><h2>The <a class="reference internal" href="#while"><tt class="xref std std-keyword docutils literal"><span class="pre">while</span></tt></a> statement</h2>
|
|
<p id="index-4">The <a class="reference internal" href="#while"><tt class="xref std std-keyword docutils literal"><span class="pre">while</span></tt></a> statement is used for repeated execution as long as an
|
|
expression is true:</p>
|
|
<pre>
|
|
<strong id="grammar-token-while_stmt">while_stmt</strong> ::= "while" <a class="reference internal" href="expressions.html#grammar-token-expression"><tt class="xref docutils literal"><span class="pre">expression</span></tt></a> ":" <a class="reference internal" href="#grammar-token-suite"><tt class="xref docutils literal"><span class="pre">suite</span></tt></a>
|
|
["else" ":" <a class="reference internal" href="#grammar-token-suite"><tt class="xref docutils literal"><span class="pre">suite</span></tt></a>]
|
|
</pre>
|
|
<p>This repeatedly tests the expression and, if it is true, executes the first
|
|
suite; if the expression is false (which may be the first time it is tested) the
|
|
suite of the <a class="reference internal" href="#else"><tt class="xref std std-keyword docutils literal"><span class="pre">else</span></tt></a> clause, if present, is executed and the loop
|
|
terminates.</p>
|
|
<p id="index-5">A <a class="reference internal" href="simple_stmts.html#break"><tt class="xref std std-keyword docutils literal"><span class="pre">break</span></tt></a> statement executed in the first suite terminates the loop
|
|
without executing the <a class="reference internal" href="#else"><tt class="xref std std-keyword docutils literal"><span class="pre">else</span></tt></a> clause’s suite. A <a class="reference internal" href="simple_stmts.html#continue"><tt class="xref std std-keyword docutils literal"><span class="pre">continue</span></tt></a>
|
|
statement executed in the first suite skips the rest of the suite and goes back
|
|
to testing the expression.</p>
|
|
</div>
|
|
</div></body></html>
|