Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Simple Module Code

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49510] Simple Module Code
  • From: "Doug" <umdougmm at hotmail.com>
  • Date: Thu, 22 Jul 2004 02:45:44 -0400 (EDT)
  • Organization: The University of Manitoba
  • Sender: owner-wri-mathgroup at wolfram.com

Does anyone know why the following code would not work inside a module?
list = AppendTo[list, data];

here's the exact code
splitData[data_, list_, i_] := Module[{},
Print["In Split Data ", i];

If[data[[i,1]]==1, list = AppendTo[list, data[[i, 2]]]];
Print["Length of list is: ", Length[list]];
]

which is called by:
Do[splitData[data, list, i], {i, 1, Length[data]}]

It complains about to many recursions, yet on the command line alone,
list = AppendTo[list, data];
works just fine?

Thanks
Doug




  • Prev by Date: Re: If-statement problems
  • Next by Date: Re: Diophantic Equations with Constraints
  • Previous by thread: Re: numerical solution of an ODE doesn't make sense
  • Next by thread: Re: Simple Module Code