Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Static variables

  • To: mathgroup at
  • Subject: [mg9339] Re: Static variables
  • From: Hein Hundal <junkmail at>
  • Date: Sat, 1 Nov 1997 03:33:25 -0500
  • Sender: owner-wri-mathgroup at

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

   staticSum = 0;
   cumulativesum[x_] := staticSum += x ]

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

Hein Hundal
send replies to hundal at

  • 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