MathGroup Archive 1999

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

Search the Archive

Re: Packages

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16199] Re: Packages
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 5 Mar 1999 00:40:38 -0500
  • References: <7bg1in$5lc@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Francisco Gutierrez1 wrote in message <7bg1in$5lc at smc.vnet.net>...
>
>Sorry for this query -it must be elementary, but it's a problem that has
>really vexed me (without any solution at sight).
>
>I write a package with a very simple structure:
>BeginPackage["anything`"]
>definition::usage="blablabla";...
>
>
>Begin["`Private`"]
>functions
>
>
>End[]
>Protect[functions]
>EndPackage[]
>
>Then, I use SaveAs Special/PackageFormat, and I save in StandardPackages (I
>have many packages not created by me in StandardPackages and I can load
them
>without any problem).   I can't find any error...But when I call anything
>(Needs["anything`"], I get the answer "context was not created when Needs
>was evaluated.
>
>What am I doing wrong?
>
>Many thanks,
>
>Francisco Gutierrez
>
>

Francesco:

You  need to have all the working code in Initialization cells (menu
Cell>Cell Properties) - all else is commented out between (* and *)
brackets.

The message "context not created ..." is also generated by Needs if the name
of the package is not the same as the package context. For example if the
above package is renamed anything2 and reloaded after quitting the kerne
(menu Kernel) the message is generated but the package is loaded and the
context "anything`" is created.

Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565







  • Prev by Date: Re: How to draw the level curves ?
  • Next by Date: Re: List of local Variables in Module
  • Previous by thread: Packages
  • Next by thread: Re: Numerical Methods