<html lang="en"> <head> <title>Continuation Lines - 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="up" href="Statements.html#Statements" title="Statements"> <link rel="prev" href="The-try-Statement.html#The-try-Statement" title="The try Statement"> <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="Continuation-Lines"></a> <p> Previous: <a rel="previous" accesskey="p" href="The-try-Statement.html#The-try-Statement">The try Statement</a>, Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a> <hr> </div> <h3 class="section">10.10 Continuation Lines</h3> <p>In the Octave language, most statements end with a newline character and you must tell Octave to ignore the newline character in order to continue a statement from one line to the next. Lines that end with the characters <code>...</code> or <code>\</code> are joined with the following line before they are divided into tokens by Octave's parser. For example, the lines <pre class="example"> x = long_variable_name ... + longer_variable_name \ - 42 </pre> <p class="noindent">form a single statement. The backslash character on the second line above is interpreted as a continuation character, <em>not</em> as a division operator. <p>For continuation lines that do not occur inside string constants, whitespace and comments may appear between the continuation marker and the newline character. For example, the statement <pre class="example"> x = long_variable_name ... # comment one + longer_variable_name \ # comment two - 42 # last comment </pre> <p class="noindent">is equivalent to the one shown above. Inside string constants, the continuation marker must appear at the end of the line just before the newline character. <p>Input that occurs inside parentheses can be continued to the next line without having to use a continuation marker. For example, it is possible to write statements like <pre class="example"> if (fine_dining_destination == on_a_boat || fine_dining_destination == on_a_train) seuss (i, will, not, eat, them, sam, i, am, i, will, not, eat, green, eggs, and, ham); endif </pre> <p class="noindent">without having to add to the clutter with continuation markers. <!-- DO NOT EDIT! Generated automatically by munge-texi.pl. --> <!-- Copyright (C) 1996-2012 John W. Eaton --> <!-- This file is part of Octave. --> <!-- Octave is free software; you can redistribute it and/or modify it --> <!-- under the terms of the GNU General Public License as published by the --> <!-- Free Software Foundation; either version 3 of the License, or (at --> <!-- your option) any later version. --> <!-- Octave is distributed in the hope that it will be useful, but WITHOUT --> <!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or --> <!-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --> <!-- for more details. --> <!-- You should have received a copy of the GNU General Public License --> <!-- along with Octave; see the file COPYING. If not, see --> <!-- <http://www.gnu.org/licenses/>. --> </body></html>