Re: Begginer's question: Saving a function for later use

*To*: mathgroup at smc.vnet.net*Subject*: [mg128041] Re: Begginer's question: Saving a function for later use*From*: "Nasser M. Abbasi" <nma at 12000.org>*Date*: Tue, 11 Sep 2012 02:31:49 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <k2k85s$16k$1@smc.vnet.net>*Reply-to*: nma at 12000.org

On 9/10/2012 3:25 AM, pedro.roberto at campus.ul.pt wrote: > Hello, > I'm just getting started on Mathematica and trying to define a function for later use. >The function is just: > > test[x_]:=x^2 > > While I don't close mathematica, I can use the function on my notebooks >but when I close it, the function disappers, I tried to save a .m file >with it but It didn't work. What do I do? > > Thanks for time, > Pedro > Just save the notebook. It will have extension .nb File->Save As-> foo.nb Then when you open foo.nb again, the function will be there. --Nasser