Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Newbie Programming question

  • To: mathgroup at
  • Subject: [mg53448] Re: [mg53436] Newbie Programming question
  • From: Sseziwa Mukasa <mukasa at>
  • Date: Wed, 12 Jan 2005 03:41:19 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

On Jan 11, 2005, at 1:32 AM, Kerry Kim wrote:

> Hello,
> Is there any way in Mathematica to store/assign a value to a variable
> whose name is in a string?  In other words something like this:
> i = 17;
> foo="var" + ToString[i];
> SomeFunctionThatConvertsStringToSymbolName[foo] = 17;
> and then assign some value (say, 23) to the variable whose name is
> contained in the foo string? (i.e. var17=23)

You have to use Evaluate since Set has the attribute HoldFirst but the 
following does what you want




  • Prev by Date: Mathematica Graphics output in an ASP.NET WebApplication
  • Next by Date: Re: Mathematica is not very clever
  • Previous by thread: Newbie Programming question
  • Next by thread: Re: Newbie Programming question