2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
2313
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
245
|
18 |
3381
|
19 ## -*- texinfo -*- |
3373
|
20 ## @deftypefn {Function File} {} perror (@var{name}, @var{num}) |
|
21 ## Print the error message for function @var{name} corresponding to the |
|
22 ## error number @var{num}. This function is intended to be used to print |
|
23 ## useful error messages for those functions that return numeric error |
|
24 ## codes. |
5642
|
25 ## @seealso{strerror} |
3373
|
26 ## @end deftypefn |
4
|
27 |
2314
|
28 ## Author: jwe |
|
29 |
2311
|
30 function perror (name, err) |
4
|
31 |
|
32 if (nargin != 2) |
6046
|
33 print_usage (); |
1577
|
34 else |
|
35 printf (strerror (name, err)); |
4
|
36 endif |
|
37 |
|
38 endfunction |