diff src/variables.cc @ 5027:da607e9daf12

[project @ 2004-09-23 01:37:57 by jwe]
author jwe
date Thu, 23 Sep 2004 01:37:58 +0000
parents efa1ba94dab5
children 11bea7392e69
line wrap: on
line diff
--- 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;