comparison doc/interpreter/errors.txi @ 19630:0e1f5a750d00

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:24:46 -0500
parents d4a920d28242 446c46af4b42
children 4197fc428c7d
comparison
equal deleted inserted replaced
19626:37d37297acf8 19630:0e1f5a750d00
4 @c 4 @c
5 @c Octave is free software; you can redistribute it and/or modify it 5 @c Octave is free software; you can redistribute it and/or modify it
6 @c under the terms of the GNU General Public License as published by the 6 @c under the terms of the GNU General Public License as published by the
7 @c Free Software Foundation; either version 3 of the License, or (at 7 @c Free Software Foundation; either version 3 of the License, or (at
8 @c your option) any later version. 8 @c your option) any later version.
9 @c 9 @c
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT 10 @c Octave is distributed in the hope that it will be useful, but WITHOUT
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 @c for more details. 13 @c for more details.
14 @c 14 @c
15 @c You should have received a copy of the GNU General Public License 15 @c You should have received a copy of the GNU General Public License
16 @c along with Octave; see the file COPYING. If not, see 16 @c along with Octave; see the file COPYING. If not, see
17 @c <http://www.gnu.org/licenses/>. 17 @c <http://www.gnu.org/licenses/>.
18 18
19 @node Errors and Warnings 19 @node Errors and Warnings
108 @example 108 @example
109 @group 109 @group
110 f () 110 f ()
111 111
112 @print{} error: Invalid call to f. Correct usage is: 112 @print{} error: Invalid call to f. Correct usage is:
113 @print{} 113 @print{}
114 @print{} -- Function File: f (ARG1) 114 @print{} -- Function File: f (ARG1)
115 @print{} 115 @print{}
116 @print{} 116 @print{}
117 @print{} Additional help for built-in functions and operators is 117 @print{} Additional help for built-in functions and operators is
118 @print{} available in the online version of the manual. Use the command 118 @print{} available in the online version of the manual. Use the command
119 @print{} `doc <topic>' to search the manual index. 119 @print{} `doc <topic>' to search the manual index.
120 @print{} 120 @print{}
121 @print{} Help and information about Octave is also available on the WWW 121 @print{} Help and information about Octave is also available on the WWW
122 @print{} at http://www.octave.org and via the help@@octave.org 122 @print{} at http://www.octave.org and via the help@@octave.org
123 @print{} mailing list. 123 @print{} mailing list.
124 @end group 124 @end group
125 @end example 125 @end example
262 262
263 @node Recovering From Errors 263 @node Recovering From Errors
264 @subsection Recovering From Errors 264 @subsection Recovering From Errors
265 265
266 Octave provides several ways of recovering from errors. There are 266 Octave provides several ways of recovering from errors. There are
267 @code{try}/@code{catch} blocks, 267 @code{try}/@code{catch} blocks,
268 @code{unwind_protect}/@code{unwind_protect_cleanup} blocks, 268 @code{unwind_protect}/@code{unwind_protect_cleanup} blocks,
269 and finally the @code{onCleanup} command. 269 and finally the @code{onCleanup} command.
270 270
271 The @code{onCleanup} command associates an ordinary Octave variable (the 271 The @code{onCleanup} command associates an ordinary Octave variable (the
272 trigger) with an arbitrary function (the action). Whenever the Octave variable 272 trigger) with an arbitrary function (the action). Whenever the Octave variable
273 ceases to exist---whether due to a function return, an error, or simply because 273 ceases to exist---whether due to a function return, an error, or simply because
368 It is also possible to enable and disable individual warnings through 368 It is also possible to enable and disable individual warnings through
369 their string identifications. The following code will issue a warning 369 their string identifications. The following code will issue a warning
370 370
371 @example 371 @example
372 @group 372 @group
373 warning ("example:non-negative-variable", 373 warning ("example:non-negative-variable",
374 "'a' must be non-negative. Setting 'a' to zero."); 374 "'a' must be non-negative. Setting 'a' to zero.");
375 @end group 375 @end group
376 @end example 376 @end example
377 377
378 @noindent 378 @noindent
379 while the following won't issue a warning 379 while the following won't issue a warning
380 380
381 @example 381 @example
382 @group 382 @group
383 warning ("off", "example:non-negative-variable"); 383 warning ("off", "example:non-negative-variable");
384 warning ("example:non-negative-variable", 384 warning ("example:non-negative-variable",
385 "'a' must be non-negative. Setting 'a' to zero."); 385 "'a' must be non-negative. Setting 'a' to zero.");
386 @end group 386 @end group
387 @end example 387 @end example
388 388
389 389