Stopping variable from being updated by dynamic

I'm trying to write a script that will dynamically update, except for one variable, say y in a block

Dynamic@F[x,y]


So that it doesn't get re-evaluated when I reopen the notebook.

• Perhaps, the option TrackedSymbols – LLlAMnYP Apr 8 '16 at 17:26
• Good idea, but what if I have only one symbol and I'd like it to be untracked? In other words I'd like F to evaluate, but x not. – Ranza Apr 8 '16 at 21:09
• then you still use Dynamic[F[x, y], TrackedSymbols :> {F}] and now only changes in F trigger an update – Mike Honeychurch Apr 8 '16 at 23:37

You might want to describe the problem you are trying to solve in more detail, the comments indicate that people aren't sure about that. Here is what I think could be what you are after:

With[{x = x},Dynamic[f[x, y]]]


using With you can insert the current value of x into the Dynamic as a constant, so it will not change anymore. Whenever the definitions for y or f change, the Dynamic will fire using the value of x which it had at evaluation time of the above expression. There are several other techniques to achieve the same thing, but I think With is probably the easiest of these to understand...