MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Static variables


Try wrapping your function in a module with the required static
variables.  Below staticSum is static and local to the function
cumaulativesum.

Module[{staticSum},
   staticSum = 0;
   cumulativesum[x_] := staticSum += x ]

Table[cumulativesum[i], {i,10}]


Hein Hundal
send replies to hundal at vicon.net


  • Prev by Date: headers and footers again
  • Next by Date: Release question
  • Previous by thread: RE: Headers and footers again
  • Next by thread: Re: Static variables