Re: Problem in loading own Package

*To*: mathgroup at smc.vnet.net*Subject*: [mg27198] Re: Problem in loading own Package*From*: Ossama Kullie <kullie at hrz.uni-kassel.de>*Date*: Fri, 9 Feb 2001 03:10:47 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Dear Roland, Thank you very mach, that was the Problem and I have now the solution. I have edit/wrote and saved the package as a Notebook in the file "Poisson.m" . One must edit/write or save the Packages as a normal text file. Best regard, Ossama ------------------------------------- Its a bug (or a feature?) if you save a notebook in menu/ file / special / package format. Check your *.m file using a text editor. Probably you will find it saved as a comment (* ... *). > > Dear Mathematica users can you help me? > > I have written the folloing package > > BeginPackage["Poisson`"] > Clear[PoissonBracket] > PoissonBracket::usage = "PoissonBracket[a, b,n] calculates the Piosson > bracket for tow functions a and b which depend on the variables p, q" > Begin["`Private`"] > PoissonBracket[a_, b_, n_] := Block[{pk, n}, > pk = > Simplify[ > Sum[D[a, q[i]]* D[b,p[i]] - D[a,p[i]] * D[b,q[i]], {i,1,n}]]] > End[] > EndPackage[] > > and I have put it in a file Poisson.m, and tried all possibilties to > load the package but it doesnot work! > Mathematica has read the file Poisson.m, but the function PoissonBracket > is not created > As Example : > Needs["Poisson`", "Poisson.m"] > give the folloing error > Needs::nocont: Context Poisson` was not created when Needs was > evaluated. > or: <<Poisson` > then > ?? PoissonBracket > Information::notfound: Symbol PoissonBracket not found. > > or: Get["Poisson.m"] > and then > ?? PoissonBracket > nformation::notfound: Symbol PoissonBracket not found. > > the folloing information may be usfel to anser my quation > $ContextPath > Context[Poisson] > ?? Poisson > > this give the Output > > {"Global`", "System`"} > "Global`" > "Global`Poisson" > the funktion PoissonBracke work very well, when I create it in my > Notebook, only in a package doesnot! > I cannot find any error, why I cannot load the > function PoissonBracket from the pachage? . -- Roland Franzius +++ exactly <<n>> lines of this message have value <<FALSE>> +++