comparison src/variables.cc @ 6257:44c91c5dfe1d

[project @ 2007-01-30 19:16:52 by jwe]
author jwe
date Tue, 30 Jan 2007 19:16:55 +0000
parents 4036e6fca790
children ea65de49e18e
comparison
equal deleted inserted replaced
6256:83949ae13b2c 6257:44c91c5dfe1d
2036 2036
2037 if (fcn) 2037 if (fcn)
2038 retval = mislocked (fcn->name ()); 2038 retval = mislocked (fcn->name ());
2039 else 2039 else
2040 error ("mislocked: invalid use outside a function"); 2040 error ("mislocked: invalid use outside a function");
2041 }
2042 else
2043 print_usage ();
2044
2045 return retval;
2046 }
2047
2048 DEFUN (__lock_global__, args, ,
2049 "-*- texinfo -*-\n\
2050 @deftypefn {Built-in Function} {} __lock_global__ (@var{name})\n\
2051 @end deftypefn")
2052 {
2053 octave_value retval;
2054
2055 if (args.length () == 1)
2056 {
2057 std::string nm = args(0).string_value ();
2058
2059 if (! error_state)
2060 {
2061 symbol_record *sr = global_sym_tab->lookup (nm);
2062
2063 if (sr)
2064 sr->make_eternal ();
2065 else
2066 error ("__lock_global__: %s not found in global symbol table",
2067 nm.c_str ());
2068 }
2069 else
2070 error ("__lock_global__: expecting argument to be a character string");
2041 } 2071 }
2042 else 2072 else
2043 print_usage (); 2073 print_usage ();
2044 2074
2045 return retval; 2075 return retval;