Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Dynamic (more)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87703] Dynamic (more)
  • From: Gianluca Gorni <gianluca.gorni at dimi.uniud.it>
  • Date: Wed, 16 Apr 2008 04:59:13 -0400 (EDT)

Hi!

The following gives the (expected?) result 1:

p = 0;
q = 0;
Dynamic[q = p + 1];
Dynamic[q]

This one gives {1, 1}, also as I would expect:

DynamicModule[{p, q},
  p = 0;
  q = 0;
  {Dynamic[q = p + 1],
   Dynamic[q]}]


Can anybody explain why the next gives 0?

DynamicModule[{p, q},
  p = 0;
  q = 0;
  Dynamic[q = p + 1];
  Dynamic[q]
]


Try the following pair too:

DynamicModule[{p = 0, q}, {Dynamic[q = p + 1], Dynamic[q]}]

DynamicModule[{p = 0, q}, Dynamic[q = p + 1]; Dynamic[q]]



Luca



  • Prev by Date: Re: A Problem with Simplify
  • Next by Date: Re: EdgeRenderingFunction to produce edge labels in GraphPlot
  • Previous by thread: Re: A kernel, multiple notebooks, and Global?
  • Next by thread: Re: Dynamic (more)