|
From: | Michael Johnson |
Subject: | Re: clearing global variables |
Date: | Wed, 6 Oct 2010 17:42:56 -0500 |
From: Michael JohnsonSent: Thursday, October 07, 2010 12:32 AMCc: address@hiddenSubject: Re: clearing global variablesThanks Dmitri,
Unfortunately that didn't work:
octave:1> global VAR = 1;
octave:2> clear VAR
octave:3> global VAR = 0;
octave:4> VAR
VAR = 1
Here's a lame workaround that I came up with - included for the archives.
octave:1> global VAR; VAR = 1;
octave:2> clear all
octave:3> VAR
error: `VAR' undefined near line 3 column 1
octave:3> global VAR; VAR = 0;
octave:4> VAR
VAR = 0
So, for future reference, does this list expect people to be using the development code (aka 3.3.52). If so, is there a plan for an official release soon? I deliver octave simulations to customers who are unwilling or unable to compile octave themselves.
Mike
On Wed, Oct 6, 2010 at 5:12 PM, Dmitri A. Sergatskov <address@hidden> wrote:
I suspect in your version of octave "clear" does not interpret "all"On Wed, Oct 6, 2010 at 5:00 PM, Michael Johnson
<address@hidden> wrote:
> Hi,
>
> I'm new to this list, so please forgive me if this has been discussed. I
> searched through the mailing list history, but found no recent discussions
> of this issue.
>
> I am using octave 3.2.4 on Fedora 11, and I'm unable to clear global
> variables. I have a few questions: Am I doing something wrong? Is this
> intended behavior? Is this a bug? Here's some example code:
>
> octave:1> global VAR = 1;
> octave:2> clear all
> octave:3> global VAR = 0;
> octave:4> VAR
> VAR = 1
>
> I would really think VAR would be redefined to be 0 after the clear all...
>
> Thanks,
> Mike
as a special keyword and instead is trying to clear variable with
name "all". It has been fixed in later version. It works as expected
on octave 3.3.52+ on my computer. You can do
"clear VAR" as a workaround.
Sincerely,
Dmitri.
--
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octaveYou can also use <clear global> which behaves in 3.2.4 as it should!/Fotis
[Prev in Thread] | Current Thread | [Next in Thread] |