[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Are built-in variables global?
From: |
John W. Eaton |
Subject: |
Are built-in variables global? |
Date: |
Tue, 20 Jun 2006 20:48:52 -0400 |
On 20-Jun-2006, Joshua Rigler wrote:
| OK, probably a dumb question, but like the subject line asks, are
| built-in variables global in scope?
If you mean are they in the same scope as variables declared "global",
then the answer is no.
| The only reason I ask is that I currently have a very long-running
| program which periodically dumps me into debug mode via the keyboard
| command. Sometimes I am just too impatient to wait for the next
| scheduled "debug session", and I want to be able to type ctl-c to drop
| into debug mode on a whim. The problem is that I failed to set
| debug_on_interrupt before I started the program. I guess what I really
| want to know is whether or not I can set debug_on_interrupt at the next
| scheduled break point, and be confident that this built-in variable will
| stay set from that point forward.
Yes, I think that should work.
BTW, in the current development sources (2.9.6 and forward) there are
no more built-in variables. They have all been replaced by functions,
so instead of writing
debug_on_interrupt = true;
you have to write
debug_on_interrupt (true);
More info about this and other significant backward incompatible
changes you will encounter with Octave 3.0 may be found here:
http://velveeta.che.wisc.edu/cgi-bin/cvsweb.cgi/octave/NEWS?rev=1.62
jwe