Mercurial > octave-nkf
comparison src/variables.cc @ 6416:59a4304b7cc5
[project @ 2007-03-15 20:37:44 by jwe]
author | jwe |
---|---|
date | Thu, 15 Mar 2007 20:37:44 +0000 |
parents | 9b525feab43b |
children | 82d0132889e4 |
comparison
equal
deleted
inserted
replaced
6415:6b1535a09268 | 6416:59a4304b7cc5 |
---|---|
2032 | 2032 |
2033 if (fcn) | 2033 if (fcn) |
2034 retval = mislocked (fcn->name ()); | 2034 retval = mislocked (fcn->name ()); |
2035 else | 2035 else |
2036 error ("mislocked: invalid use outside a function"); | 2036 error ("mislocked: invalid use outside a function"); |
2037 } | |
2038 else | |
2039 print_usage (); | |
2040 | |
2041 return retval; | |
2042 } | |
2043 | |
2044 DEFUN (__lock_global__, args, , | |
2045 "-*- texinfo -*-\n\ | |
2046 @deftypefn {Built-in Function} {} __lock_global__ (@var{name})\n\ | |
2047 @end deftypefn") | |
2048 { | |
2049 octave_value retval; | |
2050 | |
2051 if (args.length () == 1) | |
2052 { | |
2053 std::string nm = args(0).string_value (); | |
2054 | |
2055 if (! error_state) | |
2056 { | |
2057 symbol_record *sr = global_sym_tab->lookup (nm); | |
2058 | |
2059 if (sr) | |
2060 sr->make_eternal (); | |
2061 else | |
2062 error ("__lock_global__: %s not found in global symbol table", | |
2063 nm.c_str ()); | |
2064 } | |
2065 else | |
2066 error ("__lock_global__: expecting argument to be a character string"); | |
2067 } | 2037 } |
2068 else | 2038 else |
2069 print_usage (); | 2039 print_usage (); |
2070 | 2040 |
2071 return retval; | 2041 return retval; |