Re: How to make dynamic strings?
- To: mathgroup at smc.vnet.net
- Subject: [mg111925] Re: How to make dynamic strings?
- From: telefunkenvf14 <rgorka at gmail.com>
- Date: Thu, 19 Aug 2010 07:21:09 -0400 (EDT)
- References: <email@example.com>
On Aug 18, 6:04 am, 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:= par1 = 200; > par2 = Dynamic[par1]; > par3 = ToString[par2] > > Out= "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 In:= x=1 Out= 1 In:= (* Initially this will evaluate to 1 *) y=Dynamic[ToString[x]] Out= 3 In:= (* Once you evaluate this, above changes to 3---note that it is in String format; see this by clicking in the output cell and pressing space *) x=3 Out= 3 -RG