Re: How to make dynamic strings?
- To: mathgroup at smc.vnet.net
- Subject: [mg111932] Re: How to make dynamic strings?
- From: Simon <simonjtyler at gmail.com>
- Date: Thu, 19 Aug 2010 07:22:26 -0400 (EDT)
- References: <i4geoc$jaq$1@smc.vnet.net>
Hi Sam, I don't know if this is the best way to do things, but every Dynamic object is of the form Dynamic[expr]. So if you ask for the first element, then you just get (and evaluate) expr. In[1]:= par10; par2=Dynamic[par1]; par3=ToString[First[par2]] Out[3]= 200 In[4]:= FullForm[par3] Out[4]//FullForm= "200" On Aug 18, 9:04 pm, sam ti83 <sam_t... at hotmail.com> wrote: > Hi, > > I'd like to make a string from a dynamic expression. I don't know how to do that since mathematica doesn't recognize the regular way of making strings from normal expressions (see below) - and I can't find any documentation on this problem. So your help is very welcome! > > This is a very simple example to illustrate my problem: > > In[378]:= par1 = 200; > par2 = Dynamic[par1]; > par3 = ToString[par2] > > Out[380]= "Dynamic[par1]" > > Instead of having par3 = "200", I get par3= "Dynamic[par1]". Do you know why mathematica doesn't evaluate a dynamic expression in ToString? Any solutions?? > > Thanks, > Sam