MathGroup Archive 2004

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

Search the Archive

Re: Subject: Calling one notebook into another

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52297] Re: Subject: [mg52297] Calling one notebook into another
  • From: Peter Pein <petsie at arcor.de>
  • Date: Sun, 21 Nov 2004 07:23:38 -0500 (EST)
  • References: <cnn1eq$8th$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Roger Bagula wrote:
> Hi everyone,
>             I am have a for loop running in one notebook file which 
> needs some calculations to be done every time it starts over. I made 
> a second notebook which does these calculations and tried to call it 
> into the first one by initializing the cell and using the save as 
> special>Package Format. Then tried to call it into the first 
> notebook with the command <file.m.
>               This didn't work for me is there anyway in Mathematica 
> where we call a subroutine which carries some value with it each 
> time like in C-Language.
> 
> Thank you,
> Nagu
> 
> 
> Respectfully, Roger L. Bagula
> 
> tftn at earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :
> alternative email: rlbtftn at netscape.net
> URL :  http://home.earthlink.net/~tftn
> 
I'm not sure if I understood your problem, but if I save the following lines 
with all cells marked as initialisation cells in a notebook with associated 
.m-file named Firlefanz.nb (and .m):

Print["first action"];

Print["second action"];

Ask[q_] := Print[q <> "?"];

and restart Mathematica and enter some lines of code, I get the following output:

In[1]:=
<< "firlefanz.m"
 From In[1]:=
"first action"
 From In[1]:=
"second action"
In[2]:=
Ask["So what"]
 From In[2]:=
"So what?"

-- 
Peter Pein
10245 Berlin


  • Prev by Date: Re: "+ -" in an output line?
  • Next by Date: Re: Difference between scalar and vector inequality!
  • Previous by thread: Re: Subject: Calling one notebook into another
  • Next by thread: Re: Subject: Calling one notebook into another