Re: Evaluating Global Variables Named Strings as Variables
- To: mathgroup at smc.vnet.net
- Subject: [mg105491] Re: Evaluating Global Variables Named Strings as Variables
- From: BenT <brtubb at pdmusic.org>
- Date: Sat, 5 Dec 2009 05:32:32 -0500 (EST)
- References: <hfalai$73l$1@smc.vnet.net>
Thanks to Bob Hanlon, for pointing out to me two solutions, for which I choose the second, namely: [1] Grid[ a = {#, ToExpression[#]} & /@ {"$AddOnsDirectory", "$BaseDirectory"}, Spacings -> {1.5, 1.5}] [2] Column[Flatten[ a = {#, ToExpression[#]} & /@ {"$AddOnsDirectory", "$BaseDirectory"}], Spacings -> 1.5] Which for my purposes was adapted to Column[Flatten[ a = {#, ToExpression[#]} & /@ Names["System`$*"]], Spacings -> 1.5] --- Ben On Dec 4, 3:38 am, BenT <brt... at pdmusic.org> wrote: > 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
- Follow-Ups:
- Re: Evaluating Global Variables Named Strings as
- From: Syd Geraghty <sydgeraghty@me.com>
- Re: Evaluating Global Variables Named Strings as