Mercurial > hg > octave-lyh
diff src/ov-cell.cc @ 6833:e8a18d380097
[project @ 2007-08-27 17:22:50 by jwe]
author | jwe |
---|---|
date | Mon, 27 Aug 2007 17:22:51 +0000 |
parents | a6c8000f113e |
children | 9e32bb109980 |
line wrap: on
line diff
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -59,6 +59,12 @@ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_cell, "cell", "cell"); +static void +gripe_failed_assignment (void) +{ + error ("assignment to cell array failed"); +} + octave_value_list octave_cell::subsref (const std::string& type, const std::list<octave_value_list>& idx, int nargout) @@ -228,8 +234,13 @@ else octave_base_matrix<Cell>::assign (i, Cell (t_rhs)); - count++; - retval = octave_value (this); + if (! error_state) + { + count++; + retval = octave_value (this); + } + else + gripe_failed_assignment (); } break; @@ -250,8 +261,13 @@ else octave_base_matrix<Cell>::assign (i, Cell (t_rhs)); - count++; - retval = octave_value (this); + if (! error_state) + { + count++; + retval = octave_value (this); + } + else + gripe_failed_assignment (); } break;