RE: Package problem
- To: mathgroup at smc.vnet.net
- Subject: [mg34721] RE: [mg34711] Package problem
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 3 Jun 2002 01:46:40 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Graham, > > The package starts : > BeginPackage["Roulette`BallSim1`"] > So far, so good. Now create a folder named Roulette in the AddOns\ExtraPackages folder. Put your package notebook there. Your package notebook should have the name BallSim1.nb. Make all of the statements in your notebook separate cells as far as possible. And make them Initialization cells. When you save your notebook choose to create an AutoSavePackage. This will create the BallSim1.m package file and each time you modify the BallSim1.nb notebook and save it, the package file will also automatically be updated. You should never have to directly edit a .m file. Now load the package with Needs["Roulette`BalSim1`"] Also, I'm believe the names are case sensitive. Notice that the leading context names are like directory paths. Mathematica automatically looks in StandardPackages and ExtraPackages so you only have to give the context path from that point down. That should work. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: Graham [mailto:lamontgra at yahoo.com] To: mathgroup at smc.vnet.net > > I am trying to create a package and read it in. > > The package starts : > BeginPackage["Roulette`BallSim1`"] > > BallFall::usage = "Performs simulation of ball motion through fluid" > (* BallFall > a:: drag coefficient (a*v^2) > > > But I get this: > > Get["ballsim1`"] > Notebook[{Cell[ > BoxData[{RowBox[{RowBox[{"BeginPackage", "[", > "\"Roulette`BallSim1`\"", > "]"}], "\n"}], "\[IndentingNewLine]", > RowBox[{RowBox[{"BallFall", "::", "usage"}], "=", " ", > RowBox[{"\"Performs simulation of ball motion > through fluid\"", > "\[IndentingNewLine]", " "}], > RowBox[{"(*", " ", > RowBox[{"BallFall", "\n", > RowBox[{RowBox[{"a", "::", " ", "drag"}], " ", > "coefficient", > > > Whtas happening ? > Is the file corrupt perhaps ? > Can you edit .m files in the notebook interface ? > > Thanks > Graham >