Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: print variable name and its value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99998] Re: print variable name and its value
  • From: "Marc B. Reynolds" <marc.reynolds at orange.fr>
  • Date: Thu, 21 May 2009 00:08:03 -0400 (EDT)

Something like this works:

DumpVar[x_] := Print[ToString[HoldForm[x]], ":", x];
SetAttributes[DumpVar, {Listable, HoldAll}]


x:=1;
y=2;

DumpVar[x];
DumpVar[y];
DumpVar[{x,y}];


  • Prev by Date: Integrate Bug
  • Next by Date: GeoDistance gives other value than SpheroidalDistance
  • Previous by thread: print variable name and its value
  • Next by thread: Re: print variable name and its value