Mercurial > octave-nkf
view examples/structdemo.cc @ 12687:6d4c18565de1
Deprecate error_text(), __error_text__()
* __error_text__.m, error_text.m: New functions added to deprecated/ directory
to issue warning message.
* NEWS: Add functions to list of deprecated functions in 3.6.
* mk_undocumented_list: Remove error_text from alias list.
* demo.m, test.m: Replace __error_text__ with lasterr
* error.cc: Remove DEFALIAS of functions to lasterr.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 25 May 2011 14:09:00 -0700 |
parents | db1f49eaba6b |
children | be41c30bcb44 |
line wrap: on
line source
#include <octave/oct.h> #include <octave/ov-struct.h> DEFUN_DLD (structdemo, args, , "Struct demo.") { int nargin = args.length (); octave_value retval; if (args.length () == 2) { octave_scalar_map arg0 = args(0).scalar_map_value (); if (! error_state) { std::string arg1 = args(1).string_value (); if (! error_state) { octave_value tmp = arg0.contents (arg1); if (tmp.is_defined ()) { octave_scalar_map st; st.assign ("selected", tmp); retval = octave_value (st); } else error ("sruct does not contain field named '%s'\n", arg1.c_str ()); } else error ("expecting character string as second argument"); } else error ("expecting struct as first argument"); } else print_usage (); return retval; }