MathGroup Archive 2000

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

Search the Archive

Re: init.m questions and message windows

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23651] Re: init.m questions and message windows
  • From: Dave Richardson <dhr at glue.umd.edu>
  • Date: Sun, 28 May 2000 23:09:02 -0400 (EDT)
  • Organization: University of Maryland
  • References: <8gicsr$i8h@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

jwojtkie at my-deja.com wrote:

> I am trying to create some packages for functions that I use often.  I
> want to put them in my e:\home\mathematica\ directory so they aren't
> lost in the mathematica directory tree and in a place that I back up
> often.
> I want to be able to call them like the standard packages. like
> <<MyStuff`Test`
> to find the package at e:\home\mathematica\MyStuff\Test.m
>
> I can't get mathematica to find the files though.  I don't understand
> how the contexts work.  I tried to append the directory
> (e:\home\mathematica\) to the $Path but that doesn't work.  The output
> shows it adds it but the next time I look at $Path the new item is gone.
>
> How do people here manage their new packages?  Am I missing something
> I've gone through all my books but they don't help.
>
> Another unrelated question.  Can you send all messages to that special
> message window that pops up when you put Print[] statements in your
> init.m file.  I could see how this would be useful to me sometimes but
> can't figure out how to do it.
>
> Thanks for the help.
> Jeff
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Jeff,

I created a new directory (Custom Packages), and put all of my Packages in
there.

Then you need to modify you init.m file.

There are several, but the one in the :
...\Wolfram Research\Mathematica\4.0\Configuration\Kernel
directory works.

Just before:
Begin["System`Private`"]
Add
AppendTo[$Path, "D:\\Program Files\\Wolfram
Research\\Mathematica\\4.0\\AddOns\\Custom Packages"]

Note: Change the "Path" to whatever your actual path to the files is...


My init.m file looks like the following:


(** User Mathematica initialization file **)

(** Decide how to display graphics on this machine **)
AppendTo[$Path, "D:\\Program Files\\Wolfram
Research\\Mathematica\\4.0\\AddOns\\Custom Packages"]
Begin["System`Private`"]

(* Hide any symbols which are created *)

Which[
        $Remote || $ParentLink =!= Null,               <<"PSDirect.m",
        Environment["DISPLAY"]        =!= $Failed,     <<"Motif.m",
        $SystemID == "NeXT",                           <<"NeXT.m",
        $SystemID == "NeXT-Intel",                     <<"NeXT.m",
        $SystemID == "NeXT-HP",                        <<"NeXT.m",
        $SystemID == "NeXT-SPARC",                     <<"NeXT.m",
        True,                                          <<"Terminal.m"
     ]

End[]


Hope this helps!

Dave!


--
Dave Richardson
University of Maryland
Department of Mechanical Engineering
Center for Environmental Energy Engineering
(301) 405-8726
dhr at glue.umd.edu




  • Prev by Date: FindMinimum of a compiled function??
  • Next by Date: Re: need little help - no longer!(2)
  • Previous by thread: init.m questions and message windows
  • Next by thread: problem