MathGroup Archive 2010

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

Search the Archive

Return intermediate reference using Hold*****?

Hello -

Supposing I have declared:
x = 1
y = x

Is there a function that can take y as an argument and return  "x"?

I would like to use it like this:

GrassA = 1
GrassB = 2
GrassType = GrassA  (*<---- I will toggle this for different model

(*Lots of code and calculations, followed by summary printout *)

Print[Row[{"GrassType = ", HOLDLIKEFUNCTION[GrassType], "\tDepth = ",

HoldForm[GrassType] returns "GrassType," instead of the desired

For now, I am using:
Clear[GrassA, GrassB]
Print[Row[{"GrassType = ", HOLDLIKEFUNCTION[GrassType], "\tDepth = ",

Which has the desired effect, so I am not desparate for a solution -
just wonder how other people would approach this.

  • Prev by Date: FortranForm
  • Next by Date: Table of Values
  • Previous by thread: Re: FortranForm
  • Next by thread: Re: Return intermediate reference using Hold*****?