Re: Static variables
- To: mathgroup at smc.vnet.net
- Subject: [mg9339] Re: Static variables
- From: Hein Hundal <junkmail at vicon.net>
- Date: Sat, 1 Nov 1997 03:33:25 -0500
- Sender: owner-wri-mathgroup at wolfram.com
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