Mercurial > hg > octave-nkf
diff src/variables.cc @ 11558:1e4dfc7a9487
use .argn. to store argument names for inputname function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 17 Jan 2011 13:59:35 -0500 |
parents | e582adc89d55 |
children | 12df7854fa7c |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -2545,3 +2545,26 @@ feval (func_name, octave_value (name)); } } + +DEFUN (__varval__, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} __varval__ (@var{name})\n\ +Undocumented internal function.\n\ +@end deftypefn") +{ + octave_value retval; + + if (args.length () == 1) + { + std::string name = args(0).string_value (); + + if (! error_state) + retval = symbol_table::varval (args(0).string_value ()); + else + error ("__varval__: expecting argument to be variable name"); + } + else + print_usage (); + + return retval; +}