help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clearing global variables


From: Francesco Potortì
Subject: Re: clearing global variables
Date: Thu, 07 Oct 2010 09:10:07 +0200

>Ah, thanks Fotis. That's much nicer.

Please, do not top post on this list, and trim your quoting to just
what's necessary.

>> 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

I just issue clear twice:

octave> version
ans = 3.2.4
octave> global v=1
octave> clear
octave> clear
octave> global v=0
octave> v
v = 0

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]