Re: Executing external notebook
- To: mathgroup at smc.vnet.net
- Subject: [mg92757] Re: Executing external notebook
- From: Tyler <hayes.tyler at gmail.com>
- Date: Sun, 12 Oct 2008 04:34:00 -0400 (EDT)
- References: <gcq09i$c30$1@smc.vnet.net>
I think what you want is to make common a package, that is, a ".m" file. You would then use: Needs[BaseDir`common`] or <<BaseDir`common Where common.m is your package of portable code. I am also new to Mathematica and have had similar basic questions come to my mind as well. I feel your pain. Trust me, it's not a dumb question. I didn't realize anything about packages until I read Roman Maeder's, "Programming in Mathematica - 3rd Edition." I find that a lot of the newer texts focus on demonstrating the use of the front end. And then, maybe as an appendix, or a chapter at the end of the book, they'll describe a package. Maeder on the other hand dives right into packages, perhaps because he wrote the book for Mathematica 3 and the front wasn't as powerful as it is now. In a nutshell, this is how I've come to understand packages and notebooks. On Oct 11, 6:48 am, pdin... at gmail.com wrote: > I have a really trivial question, but nevertheless am stuck. > > Within a notebook file, how do I execute an external notebook and keep > all the results in memory? > > For example I have 5 files, > main1.nb > main2.nb > main3.nb > main4.nb > main5.nb > > each of which must call > common.nb > > which contains code that is common to all 5 main files. > > It seems like this should be easy to do but I cannot find an > appropriate command (Get seems like it is intended for this purpose, > but perhaps I am not using it correctly).