help-octave
[Top][All Lists]
Advanced

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

Re: global variables


From: Doug Stewart
Subject: Re: global variables
Date: Tue, 21 Jan 2014 11:29:46 -0500




On Tue, Jan 21, 2014 at 9:32 AM, louis scott <address@hidden> wrote:
explains it, no you cannot.
"A global variable may only be initialized once in a global statement. "

So while you cannot change, you can set inside a function.


I think you are wrong.
You can can change its value in a function, otherwise why is it called a variable??


 
I admit, I never use them. I instead have a structure with state.

myvars.x = 22;
myvars.createfile = true;

myvars.madeitup_failure = makeitup(myvars, otherstuff);

function error_code = makeitup(statevars, otherstuff)
:
:


On Tue, Jan 21, 2014 at 2:16 PM, Jabcok <address@hidden> wrote:
Hello,

I would like to know if there is any possible way to change the value of global variable from the inside of the function in Octave?

Best regards.

Sławomir Jabłoński




_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave




--
DASCertificate for 206392


reply via email to

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