diff src/variables.cc @ 5791:70215aff5ccf

[project @ 2006-05-04 18:38:45 by jwe]
author jwe
date Thu, 04 May 2006 18:38:45 +0000
parents faafc2d98b8d
children 1138ced03f14
line wrap: on
line diff
--- a/src/variables.cc	Thu May 04 18:33:11 2006 +0000
+++ b/src/variables.cc	Thu May 04 18:38:45 2006 +0000
@@ -1256,6 +1256,52 @@
 
 // Variable values.
 
+octave_value
+set_internal_variable (bool& var, const octave_value_list& args,
+		       const char *nm)
+{
+  octave_value retval = var;
+
+  int nargin = args.length ();
+
+  if (nargin == 1)
+    {
+      bool bval = args(0).bool_value ();
+
+      if (! error_state)
+	var = bval;
+      else
+	error ("%s: expecting arg to be a logical value", nm);
+    }
+  else if (nargin > 1)
+    print_usage ("automatic_replot");
+
+  return retval;
+}
+
+octave_value
+set_internal_variable (std::string& var, const octave_value_list& args,
+		       const char *nm)
+{
+  octave_value retval = var;
+
+  int nargin = args.length ();
+
+  if (nargin == 1)
+    {
+      std::string sval = args(0).string_value ();
+
+      if (! error_state)
+	var = sval;
+      else
+	error ("%s: expecting arg to be a character string", nm);
+    }
+  else if (nargin > 1)
+    print_usage ("automatic_replot");
+
+  return retval;
+}
+
 // Look for the given name in the global symbol table.  If it refers
 // to a string, return a new copy.  If not, return 0;