Re: Mathematica frustrations...
- To: mathgroup@smc.vnet.net
- Subject: [mg11799] Re: Mathematica frustrations...
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Sat, 28 Mar 1998 00:25:37 -0500
- References: <6cgf9k$sd7@smc.vnet.net> <6d0ah6$2jt@smc.vnet.net> <199803200048.TAA05599@smc.vnet.net.> <3511F7DD.7444@gte.net> <199803212335.SAA15410@smc.vnet.net.> <6fd6fd$6cu@smc.vnet.net>
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
- References:
- Re: Re: Mathematica frustrations...
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Re: Mathematica frustrations...