help-octave
[Top][All Lists]
Advanced

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

Re: global variables


From: Michael Kopp
Subject: Re: global variables
Date: Fri, 26 May 2006 15:01:17 +0200
User-agent: Thunderbird 1.5.0.2 (X11/20060411)

Hi,

> I tried to set a variable global .. 
> 
> global DEGUB = 0;
> 
> then, some functions later..
> 
>  ... = func1(...)
>      
>     ... = func2(...)
>      
>        isglobal("DEBUG")
> 
>     (END func2)
>  
>  (END func1)
> 
> the "isglobal("DEBUG")" statement will answer with 0.. should this not be
> 1 ?

IIRC, you have to declare it as a global variable in the function body as well:
global DEBUG = 0;
... = func(...)
        global DEBUG
        isglobal("DEBUG")
endfunction

HTH,

Michael.



reply via email to

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