Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11206 > unrolled thread

Evaluation of a whole notebook from another one

Started by"Dr. Robert Kragler" <kragler@hs-weingarten.de>
First post2012-08-04 10:26 +0000
Last post2012-08-05 01:57 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Evaluation of a whole notebook from another one "Dr. Robert Kragler" <kragler@hs-weingarten.de> - 2012-08-04 10:26 +0000
    Re: Evaluation of a whole notebook from another one awnl <awnl@gmx-topmail.de> - 2012-08-05 01:52 +0000
    Re: Evaluation of a whole notebook from another one David Bailey <dave@removedbailey.co.uk> - 2012-08-05 01:57 +0000

#11206 — Evaluation of a whole notebook from another one

From"Dr. Robert Kragler" <kragler@hs-weingarten.de>
Date2012-08-04 10:26 +0000
SubjectEvaluation of a whole notebook from another one
Message-ID<jvitc7$32n$1@smc.vnet.net>
Hi,

I have a simple question:

There is a nb-file, say "Source.nb", which is called and should be evaluated as 
a whole (containing several procedures in a group of input cells) from another 
nb-file, say "Application.nb" which needs these procedures for further 
calculations.

Within "Application.nb" the notebook "Source.nb" is correctly opened and pops up 
by NotebookOpen["filepath\Source.nb"]. It is, of course, possible to evaluate 
the cell group manually but the idea is to do this automatically and then return 
after evaluation to the calling nb-file "Application.nb" and close "Source.nb" 
using NotebookClose["filepath\Source.nb"].

I miss a command such as NotebookEvaluate[...]. The commands EvaluationNotebook 
and SelectionEvaluate are not just doing what I want. Suggestions are appreciated.

R. Kragler

[toc] | [next] | [standalone]


#11210

Fromawnl <awnl@gmx-topmail.de>
Date2012-08-05 01:52 +0000
Message-ID<jvkjku$5u5$1@smc.vnet.net>
In reply to#11206
Am 04.08.2012 12:26, schrieb Dr. Robert Kragler:
> Hi,
>
> I have a simple question:
>
> There is a nb-file, say "Source.nb", which is called and should be evaluated as
> a whole (containing several procedures in a group of input cells) from another
> nb-file, say "Application.nb" which needs these procedures for further
> calculations.
>
> Within "Application.nb" the notebook "Source.nb" is correctly opened and pops up
> by NotebookOpen["filepath\Source.nb"]. It is, of course, possible to evaluate
> the cell group manually but the idea is to do this automatically and then return
> after evaluation to the calling nb-file "Application.nb" and close "Source.nb"
> using NotebookClose["filepath\Source.nb"].
>
> I miss a command such as NotebookEvaluate[...]. The commands EvaluationNotebook
> and SelectionEvaluate are not just doing what I want. Suggestions are appreciated.
>
> R. Kragler
>

Which version are you using? Since Version 8 there is exactly that function:

?NotebookEvaluate
NotebookEvaluate[notebook] evaluates all the evaluatable cells in 
notebook. >>

On the other hand, I'm almost sure that it's not the best possible way 
to have your "library" in the form of a notebook to be evaluated. Maybe 
you want to have a look at how to organize your code into package-files 
with proper use of Contexts (or namespaces), see e.g. the documentation 
of BeginPackage and EndPackage...

hth,

albert

[toc] | [prev] | [next] | [standalone]


#11218

FromDavid Bailey <dave@removedbailey.co.uk>
Date2012-08-05 01:57 +0000
Message-ID<jvkjti$5v3$1@smc.vnet.net>
In reply to#11206
On 04/08/2012 11:26, Dr. Robert Kragler wrote:
> Hi,
>
> I have a simple question:
>
> There is a nb-file, say "Source.nb", which is called and should be evaluated as
> a whole (containing several procedures in a group of input cells) from another
> nb-file, say "Application.nb" which needs these procedures for further
> calculations.
>
> Within "Application.nb" the notebook "Source.nb" is correctly opened and pops up
> by NotebookOpen["filepath\Source.nb"]. It is, of course, possible to evaluate
> the cell group manually but the idea is to do this automatically and then return
> after evaluation to the calling nb-file "Application.nb" and close "Source.nb"
> using NotebookClose["filepath\Source.nb"].
>
> I miss a command such as NotebookEvaluate[...]. The commands EvaluationNotebook
> and SelectionEvaluate are not just doing what I want. Suggestions are appreciated.
>
> R. Kragler
>
>

It sounds like you need NotebookEvaluate, which is new at version 8.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web