Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 1
    $\begingroup$ It works fine on my machine, what version of Mathematica are you running? (I'm on MMA 8.0.4.0, Windows 7 64bit) $\endgroup$ Commented Oct 26, 2012 at 1:26
  • $\begingroup$ Your code works as expected on my system (MMA V 8.0.4.0, Windows Vista 64bit) $\endgroup$ Commented Oct 26, 2012 at 1:26
  • $\begingroup$ I'm running 8.0.4 on OS X 10.6.8. I guess I should contact WRI support about a possible OS X issue. Thanks for checking this out on your systems. $\endgroup$ Commented Oct 26, 2012 at 2:27
  • 4
    $\begingroup$ Every part of this question touches on something which horrifies me. DynamicModule variables were never designed to escape the confines of the DynamicModule which scopes them, but scheduled tasks do quite a nice job of punching a hole in those confines. We should figure out how to deal with that problem, but haven't yet. Module, on the other hand, creates an unexpected global (not local) variable which is scoped to the current kernel session. For this reason, mixing Module and Dynamic or Manipulate is always a bad idea. That's why you get the syntax highlighting. $\endgroup$ Commented Nov 11, 2012 at 22:54
  • 3
    $\begingroup$ [continued] So there are a number of ways to do this which might appear to work at first but which are open to subtle failures. Really, the only way to get this to work is to have the scheduled task and dynamic code communicate using a global variable. You'll have to initialize this variable properly. You can hide it in a private namespace. If you hope to have multiple manipulators functioning independently, it gets more challenging. I have some thoughts about per-instance creation of unique variable names, but it would take some effort to work this up. $\endgroup$ Commented Nov 11, 2012 at 22:59