Re: Evaluating Global Variables Named Strings as Variables
- To: mathgroup at smc.vnet.net
- Subject: [mg105496] Re: Evaluating Global Variables Named Strings as Variables
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Sat, 5 Dec 2009 05:33:29 -0500 (EST)
"Nasser M. Abbasi" <nma at 12000.org> wrote in message news:... > You can try wrapping Symbol[] on it: > > In[8]:= s=Names["System`$*"][[3]] > Out[8]= $AddOnsDirectory > > In[12]:= Symbol[s] > Out[12]= C:\Documents and Settings\All Users\Application Data\Mathematica > > --Nasser > ToExpression[s] also works. --Nasser > "BenT" <brtubb at pdmusic.org> wrote in message > news:hfalai$73l$1 at smc.vnet.net... >> Consider the output of this: >> >> a=Names["System`$*"] >> >> How does one then process/evaluate each String element of the >> resulting List, as the global function name which it represents? >> >> For a more direct (simpler) example: if given >> >> a={$AddOnsDirectory,$BaseDirectory} >> >> Then this output is obtained. >> >> {C:\Documents and Settings\All Users\Application Data\Mathematica,C: >> \Documents and Settings\All Users\Application Data\Mathematica} >> >> However what I really want to be able to do is process "a" somehow so >> that I get the effect of multiple Input cells with their corresponding >> Output cells displayed, namely: >> >> $AddOneDirectory >> >> C:\Documents and Settings\All Users\Application Data\Mathematica >> >> $BaseDirectory >> >> C:\Documents and Settings\All Users\Application Data\Mathematica >> >> How is this achieved? >> >> --- Benjamin Tubb >> > >