MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Evaluating Global Variables Named Strings as Variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105495] Re: Evaluating Global Variables Named Strings as Variables
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Sat, 5 Dec 2009 05:33:17 -0500 (EST)
  • References: <hfalai$73l$1@smc.vnet.net>

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

"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
> 



  • Prev by Date: Re: Evaluating Global Variables Named Strings as
  • Next by Date: Re: Evaluating Global Variables Named Strings as Variables
  • Previous by thread: Evaluating Global Variables Named Strings as Variables
  • Next by thread: Re: Evaluating Global Variables Named Strings as Variables