MathGroup Archive 2010

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

Search the Archive

Re: Dynamic not displaying the current value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110072] Re: Dynamic not displaying the current value
  • From: "David Park" <djmpark at comcast.net>
  • Date: Tue, 1 Jun 2010 04:21:32 -0400 (EDT)

Hmm, interesting. I'm not exactly certain what you are observing, but for me
the following DOES update the display of n from the Do statement.

n = 0; 
Dynamic[n] 
Do[Pause[0.2], {n, 1, 5}] 

But then the display is not reset with:

n = 0;

I'm not certain why the Do statement updates the value because n is not
being explicitly set by the Do. The following statement also updates the
value with the Do:

n = 0; 
Dynamic[n] 
Do[Pause[0.2]; n = i, {i, 1, 5}] 

And the displayed value now also updates with:

n = 0; 

So, maybe some guru familiar with the internals of Mathematica can explain.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: Fred Simons [mailto:f.h.simons at tue.nl] 

Rarely, Dynamic does not display the current value. This is the simplest 
example I know:

n=0;
Dynamic[n]
Do[Pause[0.2],{n,1,5}]


Fred Simons
Eindhoven University of Technology




  • Prev by Date: Re: Problems running Mathematica and WordMS together in Win7
  • Next by Date: Displaying a table
  • Previous by thread: Re: Problems running Mathematica and WordMS together in Win7
  • Next by thread: Displaying a table