Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

NotebookGet/Read/EvaluateSelection Issues

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106707] NotebookGet/Read/EvaluateSelection Issues
  • From: Paul <pkshreeman at gmail.com>
  • Date: Thu, 21 Jan 2010 04:55:59 -0500 (EST)

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 to
do calculations, and take the value of "y" to do another type of
calcuation since the value of "y" remains unassigned.

Thank you!


  • Prev by Date: Re: StringCases matching on portions of sublist?
  • Next by Date: Re: StringCases matching on portions of sublist?
  • Previous by thread: Re: Text Output
  • Next by thread: Re: NotebookGet/Read/EvaluateSelection Issues