RE: Re: Executing external notebook
- To: mathgroup at smc.vnet.net
- Subject: [mg92780] RE: [mg92764] Re: Executing external notebook
- From: "Tugrul Temel" <temelt at xs4all.nl>
- Date: Mon, 13 Oct 2008 06:18:13 -0400 (EDT)
- References: <gcq09i$c30$1@smc.vnet.net> <200810120835.EAA08892@smc.vnet.net>
Dear Peter, I tried to follow your suggestion below to bring an ".m" file into a notebook and run it using the data within the current notebook. I set the current directory to where my data, nb and .m files are. SetDirectory["directory where ".nb" and ".m" files saved"] I call "CommonProgram.m" into the notebook (nb) by Get["CommonProgram`"]. The notebook already has data in it. I just want to run "CommonProgram.m" to get results using the data in the ".nb". No error message comes out but neither the results. What is wrong here? Thanks. -----Original Message----- From: Peter Pein [mailto:petsie at dordos.net] Sent: Sunday, October 12, 2008 10:35 AM To: mathgroup at smc.vnet.net Subject: [mg92780] [mg92764] Re: Executing external notebook change all input cells in common.nb to initialisation cells, save common.nb and chose in the appearing box to create an autosave package. this will generate a file common.m in the same folder as the common.nb is located in. Then you can use <<"/path/to/common" in your main[1-5].nb (of course you have to replace the "/path/to" part by the actual path to your common file). Peter pdingle at gmail.com schrieb: > 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). >
- References:
- Re: Executing external notebook
- From: Peter Pein <petsie@dordos.net>
- Re: Executing external notebook