MathGroup Archive 1999

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

Search the Archive

Re: How to: Read Notebook and auto-evaluate ?

  • To: mathgroup at
  • Subject: [mg20993] Re: How to: Read Notebook and auto-evaluate ?
  • From: paulh at (P.J. Hinton)
  • Date: Thu, 2 Dec 1999 21:41:08 -0500 (EST)
  • Organization: "Wolfram Research, Inc."
  • References: <822gff$>
  • Sender: owner-wri-mathgroup at

In article <822gff$7fe at>, pecora at (Lou Pecora) writes:

>I am unsuccessful in reading in a Notebook and automatically evaluating
>its cells.  The Mathematica book makes it sound simple, but it doesn't
>work.  What am I doing wrong?
>E.g. I have a notebook ("mynbook.nb", say)  with one line:
>This is a normal cell.  Then when running a session in another notebook I
>use Get to read it in:
>This returns lines of text about notebook stuff and shows the assignment
>xx=2 in the midst of all that.  But when I type
>xx  (enter)
>I just get xx back, not 2.  Looks like Mathematica finds the Notebook but
>does not evaluate the cells.  How can I do this?  Thanks for any help.

Your Get[] operation reads in the Mathematica expression corresponding
to the notebook document itself.  It does not evaluate the cells therein.
You can use the autogenerate package feature of the front end to save 
out Input style cells in a companion package file (e.g. mynotebook.m)
that contains evaluatable forms.

I have posted some articles in this newsgroup in the past describing
step-by-step how to do this.  You can retrieve one of the archived
postings at

Note that the name of the notebook option InitializationCellLoading
has been changed to InitializationCellEvaluation for Mathematica 4.  
Documentation for this option can be found in the online help by
evaluating this expression in a notebook.


P.J. Hinton
Mathematica Programming Group           paulh at
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: Re: Setting Path for Help Docs
  • Next by Date: RE: Checking for non-complex numerics
  • Previous by thread: How to: Read Notebook and auto-evaluate ?
  • Next by thread: Re: How to: Read Notebook and auto-evaluate ?