MathGroup Archive 2010

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

Search the Archive

Re: NotebookGet/Read/EvaluateSelection Issues

  • To: mathgroup at
  • Subject: [mg106741] Re: NotebookGet/Read/EvaluateSelection Issues
  • From: Paul <pkshreeman at>
  • Date: Fri, 22 Jan 2010 05:39:13 -0500 (EST)
  • References: <hj98as$g52$> <hj9e1n$k6t$>

On Jan 21, 6:33 am, Yves Klett <yves.kl... at> wrote:
> Hi,
> packages (.m) might be very useful in your case. Since Version 6
> .m-files are handled nicely in the fronted. There is no end of threads
> covering the use of packages.
> Regards,
> Yves
> Paul schrieb:
> > My fellow Mathematica'ians...
> > I am having difficult time figuring out whether it's my programming or
> > the bugs:... I have first notebook called xy.nb that simply has
> > y=x+3
> > and then I have another notebook that has the following:
> > test=NotebookOpen[xy.nb];
> > NotebookRead[test];
> > x=7;
> > SelectionMove[test,All,Notebook];   (*Seems I have to force selection=
> > even though there's only one cell in the entire notebook xy.nb?*)
> > SelectionEvaluate[test];
> > Print["y equals to ",y]
> > Naturally, I'd expect the output to read, "y equals to 10" but the
> > output is "y equals to y"...the variable "y" remains unevaluated or
> > unassigned.  If I re-evaluate the y (either redoing the whole thing
> > with kernel still running, or manually calling variable "y" by typing
> > in frontend, "y" and hitting shift-enter.
> > This is simple example of my project, I wanted to develop a modular-
> > style programming instead of really long single notebook to do my
> > Dissertation work..and be able to call certain functions in separate
> > notebooks (optional mathematical calculations, for instance)..and keep
> > all global variables intact to be used in all calculations (AND be
> > immediately usable once evaluated!).  Right now, I can't call xy.nb t=
> > do calculations, and take the value of "y" to do another type of
> > calcuation since the value of "y" remains unassigned.
> > Thank you!

Thank you for your reply.  Unfortunately, the creation of the package
doesn't help either.  I use Mathematica 5...and I have tried using
DumpSolve, Put/Get files, etc...the problem is that the notebook that
I "call" has complex functions, including IF statements, Loops,
etc...and the package (m.) doesn't seem to be able to generate correct
IF statements.  What I needed is the ability to call up on named
notebook (file/package/whatever) that can do this full calculations
(including the necessary logistics) then immeditately give me the
solution to apply immeditately.  The NotebookGet/EvaluateSelected only
works if I complete the sequence and then manually type in request for
the solution...for instance if I type "Print["Y equals to", y]
manually after I completed the call evaluation cell, the results are
correct.  I need it to be automatic.

  • Prev by Date: Re: Function and object naming conventions
  • Next by Date: Re: Re: More /.{I->-1} craziness
  • Previous by thread: Re: NotebookGet/Read/EvaluateSelection Issues
  • Next by thread: Re: NotebookGet/Read/EvaluateSelection Issues