Mercurial > octave
diff libinterp/corefcn/variables.cc @ 20711:7b608fadc663
Make error messages more specific about the variable and problem encountered.
* besselj.cc, bitfcns.cc, colloc.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc,
dirfns.cc, ellipj.cc, error.cc, gl-render.cc, graphics.cc, graphics.in.h,
load-path.cc, lsode.cc, lu.cc, luinc.cc, oct-hist.cc, oct-obj.cc,
octave-link.cc, quad.cc, rand.cc, symtab.cc, sysdep.cc, toplev.cc, utils.cc,
variables.cc, __init_fltk__.cc, chol.cc, fftw.cc, ov-cell.cc, ov-ch-mat.cc,
ov-class.cc, ov-classdef.cc, ov-cx-mat.cc, ov-fcn-inline.cc, ov-struct.cc,
ov-usr-fcn.cc, CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc, lo-specfun.cc,
curl.m, divergence.m, __fltk_file_filter__.m, __uiobject_split_args__.m,
uigetfile.m, doc.m, imshow.m, rref.m, subspace.m, edit.m, fileattrib.m, open.m,
substruct.m, annotation.m, axis.m, caxis.m, datetick.m, hidden.m, legend.m,
whitebg.m, colorbar.m, __add_datasource__.m, __ezplot__.m, __pie__.m,
__plt_get_axis_arg__.m, pan.m, __print_parse_opts__.m, rotate3d.m, subplot.m,
zoom.m, compan.m, addpref.m, getpref.m, setpref.m, powerset.m, bicg.m,
bicgstab.m, cgs.m, qmr.m, spaugment.m, pascal.m, moment.m, cstrcat.m,
system.tst:
Make error messages more specific about the variable and problem encountered.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 18 Nov 2015 10:40:26 -0800 |
parents | 571508c1ed06 |
children | 2469d78a1d8b |
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc Tue Nov 17 22:04:42 2015 +0100 +++ b/libinterp/corefcn/variables.cc Wed Nov 18 10:40:26 2015 -0800 @@ -131,7 +131,7 @@ ans = is_valid_function (fcn_name, warn_for, warn); } else if (warn) - error ("%s: expecting function name as argument", warn_for.c_str ()); + error ("%s: argument must be a string containing function name", warn_for.c_str ()); return ans; } @@ -147,8 +147,8 @@ if (! retval) { - std::string s = arg.xstring_value ("%s: expecting first argument to be a string", - warn_for.c_str ()); + std::string s = arg.xstring_value ("%s: first argument must be a string", + warn_for.c_str ()); std::string cmd = header; cmd.append (s); @@ -738,7 +738,7 @@ } else { - error_with_cfn ("expecting second argument to be \"local\""); + error_with_cfn ("second argument must be \"local\""); nargin = 0; } } @@ -779,7 +779,7 @@ if (nargin == 1) { - bool bval = args(0).xbool_value ("%s: expecting arg to be a logical value", nm); + bool bval = args(0).xbool_value ("%s: argument must be a logical value", nm); var = bval; } @@ -851,12 +851,12 @@ if (nargin == 1) { - int ival = args(0).xint_value ("%s: expecting arg to be an integer value", nm); + int ival = args(0).xint_value ("%s: argument must be an integer value", nm); if (ival < minval) - error ("%s: expecting arg to be greater than %d", nm, minval); + error ("%s: arg must be greater than %d", nm, minval); else if (ival > maxval) - error ("%s: expecting arg to be less than or equal to %d", + error ("%s: arg must be less than or equal to %d", nm, maxval); else var = ival; @@ -887,12 +887,12 @@ if (nargin == 1) { - double dval = args(0).xscalar_value ("%s: expecting arg to be a scalar value", nm); + double dval = args(0).xscalar_value ("%s: argument must be a scalar value", nm); if (dval < minval) - error ("%s: expecting arg to be greater than %g", minval); + error ("%s: argument must be greater than %g", minval); else if (dval > maxval) - error ("%s: expecting arg to be less than or equal to %g", maxval); + error ("%s: argument must be less than or equal to %g", maxval); else var = dval; } @@ -2661,7 +2661,7 @@ if (args.length () == 1) { - std::string name = args(0).xstring_value ("__varval__: expecting argument to be variable name"); + std::string name = args(0).xstring_value ("__varval__: first argument must be a variable name"); retval = symbol_table::varval (args(0).string_value ()); }