MathGroup Archive 1998

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

Search the Archive

Re: Mathematica frustrations...



Des Penny wrote:
> 
> Hi:
> 
> I think it might be important to point out here that you can't use %
> inside a Module to refer to the result of the command just above.  The
> reason is that the code inside a module is a compound statement and
> thus % does not refer to the output of the line above.
> 
> When I was a beginning user in Mathematica this drove me crazy for about
> a week.
> 
> Cheers,
> 
> Des Penny
> 
> Murray Eisenberg wrote:
> 
> > AGREED!  I would not use %, %%, or %n for "programming" -- just
> > on-the-fly calculations.
> >

Des:

In[1]:=
a=5;

In[2]:=
b= 7;

In[3]:=
Module[{x=%},{x,%%}]

Out[3]=
{7,5}

But, certainly, don't use this, or %n, in programming!

Allan


-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: Re: Coordinates for Implicit function
  • Next by Date: Re: commutativity
  • Prev by thread: Re: Re: Re: Mathematica frustrations...
  • Next by thread: Re: Re: Mathematica frustrations...