help-octave
[Top][All Lists]
Advanced

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

Re: global variables


From: c.
Subject: Re: global variables
Date: Wed, 22 Jan 2014 19:30:03 +0100

On 22 Jan 2014, at 18:48, st.michal88 <address@hidden> wrote:

> After that variable A does not exist.

If you want the global variable to exist in a given scope
you have to declare it as global IN THAT SCOPE.

So, in your example, if you run only 

>> test1

the variable A will be undefined in top scope.
While, if you do:

>> global A
>> test1

it will exist.

HTH,
c.




reply via email to

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