# HG changeset patch # User jwe # Date 1095903478 0 # Node ID da607e9daf12d842596929b88b2bc104ebff8ee7 # Parent 06f7ff1aee5abc3563c1dca1633429cd70194c36 [project @ 2004-09-23 01:37:57 by jwe] diff -r 06f7ff1aee5a -r da607e9daf12 src/ChangeLog --- a/src/ChangeLog Thu Sep 23 01:04:32 2004 +0000 +++ b/src/ChangeLog Thu Sep 23 01:37:58 2004 +0000 @@ -3,6 +3,10 @@ * pt-plot.cc (send_to_plot_stream): Skip automatic replot if in multiplot mode. + * variables.cc (get_global_value): New arg, silent. + * variables.h (get_global_value): Default value for silent arg is + false. + 2004-09-22 David Bateman * ov-fcn-inline.cc (Finline): When called with a single arg, derive diff -r 06f7ff1aee5a -r da607e9daf12 src/pt-plot.cc --- a/src/pt-plot.cc Thu Sep 23 01:04:32 2004 +0000 +++ b/src/pt-plot.cc Thu Sep 23 01:37:58 2004 +0000 @@ -217,7 +217,7 @@ { *plot_stream << cmd; - octave_value mm = get_global_value ("__multiplot_mode__"); + octave_value mm = get_global_value ("__multiplot_mode__", true); bool is_multiplot_mode = mm.is_true (); diff -r 06f7ff1aee5a -r da607e9daf12 src/variables.cc --- a/src/variables.cc Thu Sep 23 01:04:32 2004 +0000 +++ b/src/variables.cc Thu Sep 23 01:37:58 2004 +0000 @@ -919,7 +919,7 @@ } octave_value -get_global_value (const std::string& nm) +get_global_value (const std::string& nm, bool silent) { octave_value retval; @@ -929,12 +929,12 @@ { octave_value sr_def = sr->def (); - if (sr_def.is_undefined ()) + if (sr_def.is_defined ()) + retval = sr_def; + else if (! silent) error ("get_global_by_name: undefined symbol `%s'", nm.c_str ()); - else - retval = sr_def; } - else + else if (! silent) error ("get_global_by_name: unknown symbol `%s'", nm.c_str ()); return retval; diff -r 06f7ff1aee5a -r da607e9daf12 src/variables.h --- a/src/variables.h Thu Sep 23 01:04:32 2004 +0000 +++ b/src/variables.h Thu Sep 23 01:37:58 2004 +0000 @@ -91,7 +91,8 @@ extern octave_value lookup_function_handle (const std::string& nm); -extern octave_value get_global_value (const std::string& nm); +extern octave_value +get_global_value (const std::string& nm, bool silent = false); extern void set_global_value (const std::string& nm, const octave_value& val);