MathGroup Archive 2004

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

Search the Archive

Re: labeling problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46462] Re: labeling problem
  • From: "Peltio" <peltio at twilight.zone>
  • Date: Thu, 19 Feb 2004 03:02:20 -0500 (EST)
  • References: <c0utqu$e60$1@smc.vnet.net>
  • Reply-to: "Peltio" <peltioNOSP at Mdespammed.com.invalid>
  • Sender: owner-wri-mathgroup at wolfram.com

"Janos" wrote

>Now, I am thinking to assign a unique name to the list elements on
>these positions, like p5={g,h,i} and p9={n,o,p}.  I did not find yet
>how to create variable names with concatenation auto-magically from
>program.  In other programming languages I can do something like this:
>
>var="p"+NumToString[5]
>&var={a,b,c}

These were adapted from a previous post of mine. I hope they do what you
want.

    buildName[pos_Integer] := ToExpression[StringJoin["p", ToString[pos]]]
    setVar[pos_Integer][value_] := Set[Evaluate[buildName[pos]] , value]

cheers,
Peltio
--
New invalid address in reply to. Crafty demunging required to e-mail me.


  • Prev by Date: Re: Simplify and Gather Terms in a Polynomial
  • Next by Date: RE: Bloomberg and Mathematica
  • Previous by thread: labeling problem
  • Next by thread: Re: labeling problem