MathGroup Archive 1997

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

Search the Archive

Re: Saving edited packages

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6264] Re: [mg6261] Saving edited packages
  • From: Mario Sancho Graca <mario_sancho.graca at virgin.net>
  • Date: Thu, 6 Mar 1997 09:49:11 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

lompado at liger.uah.edu wrote:
> 
> I'm having trouble saving a package after I edit it using version 3.0
> (on a Windows '95 machine).  It appears that every time I save the
> package, the entire body of the package gets commented out (i.e.,  (*
> --body of package--*) ) and subsequent attempts at loading the newly
> saved package are unsuccessful. The error message says that the
> "Context MyPackage` was not created when Needs was evaluated" where
> MyPackage  is the name of the package.   When I use $Packages to check
> my contexts, the package is not in the context list.
> I have been trying to save the newly edited package using the "Save as
> Special - Package Format" command in the file menu.  Simply using
> "Save" in the file menu saves the package as a notebook.  I can't find
> any references in the Mathematica book regarding the correct way to
> save an edited package (or a new package for that matter).
> Incidentally, once the package has been modified, I try to save it
> with the same name as the original.  Mathematica seems to be happy
> with that though and simply queries as to whether I want to overwrite
> the old one.  The packages (both old and new) reside in the
> .\Add-Ons\Applications directory and this directory is indicated in
> the $Path command when I run it.  Finally, prior to editing (which
> entails modifying a couple of functions) the old package loads
> properly.
>  Am I missing something here?  Has anyone run into this problem or do
> you know of a reference that teaches one how to properly (re)save
> packages?
> 
> Thanks in advance for your time and consideration.
> 
> Regards,
> Artie
> University of Alabama in Huntsville
> Physics Department
> Optics Building, Room 201c
> Huntsville, Al 35899
> 
> Lompado at liger.uah.edu


Saving cells with the front end 'Save As Special... Package Format" (I
use Mathematica 3.0 For Students, on Windows 95) does encapsulate each
cell with comment characters (* *). The booklet "Getting Started with
Mathematica For Students Under Microsoft Windows", Appendix 'Import and
Export Capabilities' states that the Package Format is "an ASCII file
with all formatting information and text commented out, leaving
Mathematica commands stored in initialization cells.". This aims to
filter the typing done in the notebook in order for the kernel to read
the file. But it does not seem to work at the present time. One way that
I found to work was to save the notebook as a text file ("Save as
Special... Text") which will keep everything that was typed except the
Notebook commands eg Cell[]. My package would still not run because of
the way the front end in 3.0 handles the typing, e.g. with word-wrap and
caring about the syntax structure while the user types. I edited the
file with a text editor and deleted some newline characters in which
Mathematica got stuck. Then it worked.
	The front end has been much improved relative to version 2, and it
seems that this and other problems are bugs which need to be corrected
with patches or with the future 3.1.


-- 
Mario Sancho Graca

Email:
mario_sancho.graca at virgin.net
M.S.Graca at Warwick.ac.uk

University of Warwick
Department of Engineering
Coventry CV4 7AL
United Kingdom



  • Prev by Date: trace over finite field extension
  • Next by Date: Mathematica Win95 and Cyrix chips
  • Previous by thread: Saving edited packages
  • Next by thread: Re: Saving edited packages