[Date Index] [Thread Index] [Author Index]
Re: How to use package without manually evaluating?
On Sat, Jul 12, 2008 at 6:58 AM, David Park <djmpark at comcast.net> wrote: > Jeremy, > > > > The way that I would do it is: > > > > 1) Create a MyApplication (or whatever name you wish) folder in your > $UserBaseDirectory/Applications folder. > > 2) Make your posted file a Matrices.nb notebook file. Make each of the > cells an Initialization cell. > > 3) Change the BeginPackage statement to: > > > > BeginPackage["MyApplication`Matrices`"] > > > > 4) Save the notebook as an "Auto Generated Package" in your MyApplications > folder. (If it already exists as a notebook you can use the Options > Inspector to do this.) This automatically creates the Matrices.m file and > anytime you edit and save the Matrices.nb notebook, the Matrices.m package > file will be updated. > > > > 5) Load the package with the statement: > > > > Needs["MyApplication`Matrices`"] > > > > You could make that statement an Initialization cell in your working > notebooks. But when you save those notebooks DON'T make them Auto Generated > Packages. > > > > Generally your private Applications folder is the best place to put > packages. Mathematica automatically knows how to find them there. You may > not want this package loaded EVERY time you use Mathematica. I haven't > examined you package code completely but it seems that you have written some > routines that don't have usage statements. You need a usage statement for > each routine you want to export and have access to. > > > Thanks for the information. I didn't realize I need a usage statement for the function to be exported. I'll try your suggestions and report back if I don't succeed. Jeremy