/usr/share/doc/pyxplot/html/sec-breakcontinue.html is in pyxplot-doc 0.8.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="plasTeX" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>PyXPlot Users' Guide: The break and continue statements</title>
<link href="sect0038.html" title="Conditional Functions" rel="next" />
<link href="sect0037.html" title="While and Do Loops" rel="prev" />
<link href="sect0031.html" title="Programming and Flow Control" rel="up" />
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0037.html" title="While and Do Loops"><img alt="Previous: While and Do Loops" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sect0031.html" title="Programming and Flow Control"><img alt="Up: Programming and Flow Control" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0038.html" title="Conditional Functions"><img alt="Next: Conditional Functions" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<div class="breadcrumbs">
<span>
<span>
<a href="index.html">PyXPlot Users' Guide</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0001.html">Introduction to PyXPlot</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0031.html">Programming and Flow Control</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">The <tt class="tt">break</tt> and <tt class="tt">continue</tt> statements</b>
</span>
</span>
<hr />
</div>
<div><h1 id="sec:breakcontinue">6.7 The <tt class="tt">break</tt> and <tt class="tt">continue</tt> statements</h1>
<p> <a name="a0000000592" id="a0000000592"></a> <a name="a0000000593" id="a0000000593"></a> </p><p>The <tt class="tt">break</tt> and <tt class="tt">continue</tt> statements may be placed within loop structures to interrupt their iteration. The <tt class="tt">break</tt> statement terminates execution of the smallest loop currently being executed, and PyXPlot resumes execution at the next statement after the closing brace which marks the end of that loop structure. The <tt class="tt">continue</tt> statement terminates execution of the <i class="it">current iteration</i> of the smallest loop currently being executed, and execution proceeds with the next iteration of that loop, as demonstrated by the following pair of examples: </p><p> <tt class="tt">pyxplot> <b class="bf">for i=0 to 4 {</b></tt><br /><tt class="tt">for... > <b class="bf">if (i==2) { ; break; }</b></tt><br /><tt class="tt">for... > <b class="bf">print i</b></tt><br /><tt class="tt">for... > <b class="bf">}</b></tt><br /><tt class="tt">0</tt><br /><tt class="tt">1</tt><br /><tt class="tt">pyxplot> <b class="bf">for i=0 to 4 {</b></tt><br /><tt class="tt">for... > <b class="bf">if (i==2) { ; continue ; }</b></tt><br /><tt class="tt">for... > <b class="bf">print i</b></tt><br /><tt class="tt">for... > <b class="bf">}</b></tt><br /><tt class="tt">0</tt><br /><tt class="tt">1</tt><br /><tt class="tt">3</tt> </p><p>Note that if several loops are nested, the <tt class="tt">break</tt> and <tt class="tt">continue</tt> statements only act upon the innermost loop. If either statement is encountered outside of a loop structure, an error results. Optionally, the <tt class="tt">for</tt>, <tt class="tt">foreach</tt>, <tt class="tt">do</tt> and <tt class="tt">while</tt> commands may be supplied with a name for the loop, prefixed by the word <tt class="tt">loopname</tt>, as in the examples: </p><pre>
for i=0 to 4 loopname iloop
...
foreach i in "*.dat" loopname DatafileLoop
...
</pre><p>When loops are given such names, the <tt class="tt">break</tt> and <tt class="tt">continue</tt> statements may be followed by the name of the loop to be broken out of, allowing the user to act upon loops other than the innermost one. </p></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0037.html" title="While and Do Loops"><img alt="Previous: While and Do Loops" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sect0031.html" title="Programming and Flow Control"><img alt="Up: Programming and Flow Control" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0038.html" title="Conditional Functions"><img alt="Next: Conditional Functions" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<script language="javascript" src="icons/imgadjust.js" type="text/javascript"></script>
</body>
</html>
|