Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

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

Search the Archive

Re: about scoping in modules

  • To: mathgroup at
  • Subject: [mg85799] Re: about scoping in modules
  • From: Jens-Peer Kuska <kuska at>
  • Date: Fri, 22 Feb 2008 07:25:38 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <fpkvqk$hrr$>
  • Reply-to: kuska at


and what does

mfb[oneObj_] := Module[{ttmp = oneObj}, AppendTo[global2mfb, ttmp]]
mfa[e_] := Block[{global2mfb = e, t = 3}, mfb[t]]

mfa[{2, 3}]



P_ter wrote:
> Hello,
> in the next two modules I would like that the inner module uses a variable from the outer module.
> mfb[oneObj_] := Module[{ttmp = oneObj},AppendTo[ global2mfb, ttmp]]
> mfa[e_] := Module[{global2mfb = e, t = 3},mfb[t]  ] 
> mfa[{2,3}] gives a message that global2mfb is not a variable with a value, so it can not be changed.
> It means I do not understand the concept of module in Mathematica. My questions are:
> 1. why does it go wrong?
> 2. how can I realize what I want?
> with friendly greetings,
> P_ter

  • Prev by Date: Re: about scoping in modules
  • Next by Date: Re: how to import a block of numbers which may touch each other by
  • Previous by thread: Re: about scoping in modules
  • Next by thread: Re: about scoping in modules