Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: what corresponds to work folder in mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86008] Re: what corresponds to work folder in mathematica
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Sat, 1 Mar 2008 04:46:01 -0500 (EST)

On 2/29/08 at 6:29 AM, tdoxmail at gmail.com wrote:

>As in another system , we have work folder, where I can keep the .m
>file with the function i have created and use it directly in my
>other code.

>Is ther any thing such in Mathematica, where I can keep the .nb file
>having the code of my function and call  it in  any other file

There are a number of ways to do this. Which is best will depend
on your workflow and precisely what it is you want to achieve.

Basically, you can put the .m files in any directory/folder you
have access to. Once this is done, appending the path to that
folder to $ContextPath will make that folder searched when using
Needs or Get to load the .m file.

For example, I've written several packages (.m) files for my use
that have a variety of things I find useful at times. I've set
up a folder structure in the folder returned when executing
$UserBaseDirectory. Finally, I modified the init.m file found at

ToFileName[$UserBaseDirectory,"Kernel"]

so that $ContextPath will contain paths to the folders I want
searched. Now whenever I start Mathematica, I can used Needs etc
to load these files regardless of where the notebook I am
currently working with is stored.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Labeling axes in VectorFieldPlot3D?
  • Next by Date: RE: Creating Palettes
  • Previous by thread: RE: what corresponds to work folder in mathematica
  • Next by thread: Re: what corresponds to work folder in mathematica