Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 470

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Statements - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Evaluation.html#Evaluation" title="Evaluation">
<link rel="next" href="Functions-and-Scripts.html#Functions-and-Scripts" title="Functions and Scripts">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Statements"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Functions-and-Scripts.html#Functions-and-Scripts">Functions and Scripts</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Evaluation.html#Evaluation">Evaluation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="chapter">10 Statements</h2>

<p><a name="index-statements-688"></a>
Statements may be a simple constant expression or a complicated list of
nested loops and conditional statements.

   <p><dfn>Control statements</dfn> such as <code>if</code>, <code>while</code>, and so on
control the flow of execution in Octave programs.  All the control
statements start with special keywords such as <code>if</code> and
<code>while</code>, to distinguish them from simple expressions. 
Many control statements contain other statements; for example, the
<code>if</code> statement contains another statement which may or may not be
executed.

   <p><a name="index-g_t_0040code_007bend_007d-statement-689"></a>Each control statement has a corresponding <dfn>end</dfn> statement that
marks the end of the control statement.  For example, the
keyword <code>endif</code> marks the end of an <code>if</code> statement, and
<code>endwhile</code> marks the end of a <code>while</code> statement.  You can use
the keyword <code>end</code> anywhere a more specific end keyword is expected,
but using the more specific keywords is preferred because if you use
them, Octave is able to provide better diagnostics for mismatched or
missing end tokens.

   <p>The list of statements contained between keywords like <code>if</code> or
<code>while</code> and the corresponding end statement is called the
<dfn>body</dfn> of a control statement.

<ul class="menu">
<li><a accesskey="1" href="The-if-Statement.html#The-if-Statement">The if Statement</a>
<li><a accesskey="2" href="The-switch-Statement.html#The-switch-Statement">The switch Statement</a>
<li><a accesskey="3" href="The-while-Statement.html#The-while-Statement">The while Statement</a>
<li><a accesskey="4" href="The-do_002duntil-Statement.html#The-do_002duntil-Statement">The do-until Statement</a>
<li><a accesskey="5" href="The-for-Statement.html#The-for-Statement">The for Statement</a>
<li><a accesskey="6" href="The-break-Statement.html#The-break-Statement">The break Statement</a>
<li><a accesskey="7" href="The-continue-Statement.html#The-continue-Statement">The continue Statement</a>
<li><a accesskey="8" href="The-unwind_005fprotect-Statement.html#The-unwind_005fprotect-Statement">The unwind_protect Statement</a>
<li><a accesskey="9" href="The-try-Statement.html#The-try-Statement">The try Statement</a>
<li><a href="Continuation-Lines.html#Continuation-Lines">Continuation Lines</a>
</ul>

   </body></html>