MathGroup Archive 1999

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

Search the Archive

Re: How to save a file in package (*.m) format

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15361] Re: [mg15330] How to save a file in package (*.m) format
  • From: "wgrebe" <wgrebe at cityweb.de>
  • Date: Sat, 9 Jan 1999 23:58:20 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

>Hi Mathematica gurus,
>
>I am new to Mathematica and I need help on how to save a file in package
>(*.m) format that can be recognised and executed by Mathematica. I have
>created a small package following the standard routine,e.g. 
>BeginPackage
>Begin["`Private`"]
>...
>End[]
>EndPackage[]
>
>I then saved the file with Save as Special...Package Format with a .m
>extension, I get all the statements in the file commented out with (*
>*). How do I save the file with a .m extension in order to get an
>executable package?
>
>Thanks
>Chee


Hi Chee Lim,
When I write
a Mathematica-Package (*.m), framed by BeginPackage[] and EndPackage[],
I convert the cells that contain the executable parts of the package
(in general I have just one)
to Initialization cells by selecting them and choosing:
   Cell | Cell Properties | Initialization Cell. Then I save them by
choosing:
File | Save as special | Package Format. The Package can simply be
called at any point of any other Package or from somewhere else by:
<< *.m (load and evaluate)
Of course first you have to set the correct Directory.  Bye
                                Witold



  • Prev by Date: Re: Kalman filtering resources
  • Next by Date: Re: Saving only input cells
  • Previous by thread: How to save a file in package (*.m) format
  • Next by thread: Re: How to save a file in package (*.m) format