help-octave
[Top][All Lists]
Advanced

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

Re: moving calculation of a variable outside of function


From: Ivan Sutoris
Subject: Re: moving calculation of a variable outside of function
Date: Wed, 25 Mar 2009 23:15:58 +0100

2009/3/25 Jim Maas <address@hidden>:
> In the following code, is there a way to move the calculation of "ca" to a
> place outside the function, such that it's value  will be available to other
> functions as well?  This current code works for a single pool but I want to
> expand it to several pools and will need to use the same value of ca in
> other functions?
>
> Thanks
>
> Jim
>
>
> ----
> Jim Maas

You can use ca as global variable by adding line "global ca" both to
main script and the function (then it's value will be set every time
the function is called, and it would bea vailable to ther functions -
you need to add "global ca" also there)

Ivan Sutoris



reply via email to

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