Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8836 > unrolled thread
| Started by | John Fultz <jfultz@wolfram.com> |
|---|---|
| First post | 2012-03-02 12:54 +0000 |
| Last post | 2012-03-14 05:39 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Transfer dynamic into static variables John Fultz <jfultz@wolfram.com> - 2012-03-02 12:54 +0000
Re: Transfer dynamic into static variables Dominik Hezel <sendme2000@me.com> - 2012-03-14 05:39 +0000
| From | John Fultz <jfultz@wolfram.com> |
|---|---|
| Date | 2012-03-02 12:54 +0000 |
| Subject | Re: Transfer dynamic into static variables |
| Message-ID | <jiqfu8$84$1@smc.vnet.net> |
Dynamic's only useful and interesting purpose is to exist as output in a space on the screen. If you're assigning it to the variable 'tl', then 'tl' is pretty useless unless it ends up on the screen. So I'm left a little confused as to exactly what you're trying to accomplish.
Without more context, it's difficult for me to know exactly how to answer your question, but I'll give it two tries.
1) The Dynamic expression in tl is no different in essence than a Hold[]-wrapped expression. And so using standard expression-manipulation techniques. E.g., tl2 = First[tl] literally does what you want. But it's only going to do so at the snapshot in time when 'tl2 = First[tl]' is evaluated.
2) You could keep 'tl2' up to date by doing the assignment inside the Dynamic.
Dynamic[tl2 = {{a, "tst1"}, {c, "tst2"}}]
which would allow 'tl2' to track the variables 'a' and 'c' if they end up changing. Of course, it will only stay up-to-date when the Dynamic is updating, which will only happen if the Dynamic has an onscreen presence.
Sincerely,
John Fultz
jfultz@wolfram.com
User Interface Group
Wolfram Research, Inc.
On Mar 1, 2012, at 4:30 AM, Dominik Hezel wrote:
> Hallo,
>
> I have a complex program and now I need to convert a list with dynamic content into a list with static content, hence (simplified):
>
> tl = Dynamic[{{a, "tst1"}, {c,"tst2"}}]
>
> into
>
> tl2 ={{a, "tst1"}, {c,"tst2"}}
>
> So I can start doing normal list operations such as Extract, DeleteCases, etc. If this doesn't work I'll have quite a problem. So I'd really appreciate any advice.
>
> thanks, Dominik
>
[toc] | [next] | [standalone]
| From | Dominik Hezel <sendme2000@me.com> |
|---|---|
| Date | 2012-03-14 05:39 +0000 |
| Message-ID | <jjpav7$p45$1@smc.vnet.net> |
| In reply to | #8836 |
Hi John, thanks a lot for your answer. It's a bit complicated to explain where I need this, but I now managed to do it. I start to understand the concept of the 'Head'. However, if you are interested in the final program, I'm happy to send you the notebook. In the notebook the user can in the GUI drag blocks around, each block represents a geologic process. When finished, the user can skim through the processes with a 'time traveller' and will get a continuously updated plot and table about the chemical evolution of a rock through time and different processes. best, Dominik
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web