MathGroup Archive 2006

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

Search the Archive

Re: RE: Packages--Automated package save

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68907] Re: [mg68893] RE: [mg68835] Packages--Automated package save
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Wed, 23 Aug 2006 07:15:20 -0400 (EDT)
  • References: <200608220920.FAA26985@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I found out (from the default configuration of a Wolfram Workbench
application project) that if you make (to continue your example)
$UserBaseDirectory\Applications\ProjectX\Kernel\init.m, that init.m
will be executed on <<ProjectX`. If you have <<Project`XRoutines`
inside the init.m file, then one only has to call <<ProjectX` to load
the functions under that context.

On 8/22/06, David Park <djmp at earthlink.net> wrote:
> Karl,
>
> The easiest, and I think standard, way is to write your package statements
> in a regular Mathematica notebook, packagenotebook.nb. Use a separate cell
> for each statement. Make all the Input cells Initialization cells.
> (Ctrl-CRI).
>
> Then when you first Save the notebook Mathematica will bring up a box that
> asks if you want to make an AutoGenerated Package. Answer yes. Mathematica
> will then automatically create a packagenotebook.m file, which is the actual
> package. Every time you modify the .nb notebook and save it, the .m package
> file will also be automatically updated. You should never have to actually
> look at the .m file.
>
> If you have already created and saved the notebook without the
> AutoGeneratedPackage feature you can change this by using the Option
> Inspector. Show option values for notebook, Select Notebook Options, File
> Options and AutoGeneratedPackage.
>
> The other question is where to put the package. The method I like best, and
> also fairly standard I think, is to create a folder in your private
> Mathematica/Applications folder and put the package there. Suppose you are
> working on ProjectX and you want to call you package XRoutines. Then create
> a folder ProjectX in the Applications folder, name your package notebook
> XRoutines.nb and save it in the ProjectX folder. When you do so there will
> also be a XRoutines.m file there.
>
> Write your BeginPackage statement as
>
> BeginPackage["ProjectX`XRoutines`"]
>
> Then the package can be loaded with
>
> Needs["ProjectX`XRoutines`"]
> or
> <<ProjectX`XRoutines`
>
> You could store your notebooks for the project in the same folder or
> elsewhere.
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
>
>
>
>
>
> From: karl.daggfeldt at gih.se [mailto:karl.daggfeldt at gih.se]
To: mathgroup at smc.vnet.net
>
> Can I save a notebook as a package using front end commands (like
> NotebookSave) and in that case how? This would save me many menue
> mousclicks.
> Sincerely
> Karl Daggfeldt
>
> Link to the forum page for this post:
> http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Speci
> al:Forum_ViewTopic&pid=12867#p12867
> Posted through http://www.mathematica-users.org [[postId=12867]]
>
>
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: RE: Controlling axes labels in 3D plots
  • Next by Date: Re: Need good reference for writing Stylesheets
  • Previous by thread: RE: Packages--Automated package save
  • Next by thread: List Help Needed