MathGroup Archive 2002

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

Search the Archive

Re: Notebook Manipulation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36157] Re: [mg36145] Notebook Manipulation
  • From: Dale Horton <daleh at wolfram.com>
  • Date: Fri, 23 Aug 2002 21:34:48 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

People encounter this all the time. It is because SelectionEvaluate does 
not do what you think. It does not work like ToExpression, which causes 
immediate kernel evaluation. Instead it works like when you press 
Shift-Enter, which selects a cell for evaluation after all current 
evaluations have finished.

See 
http://support.wolfram.com/mathematica/kernel/interface/selectionevaluate.html

-Dale

At 11:25 PM 8/22/2002, Cesar Guerra wrote:
>Hi mathgroup;
>
>Trying to manipulate notebooks from the kernel I found
>an unexpected bahavior with Mathematica. First I tried
>
>the following commands one by one (they are not int
>the same cell, and they are not selected at same time
>for evaluation)
>
>nb = NotebookCreate[];
>i = 0;
>(* Purpose is a Do loop here *)
>NotebookDelete[nb]               (*1*)
>NotebookWrite[nb, "++i", All]    (*2*)
>SelectionEvaluate[nb]            (*3*)
>SelectionMove[nb, All, Cell]     (*4*)
>
>If I repeat evaluating coomands (*1,2,3,4*) one by one
>what is shown in the created notebook is an animation
>of the index i in the same cell.
>Naturally a loop must do the job. However when I
>intent to collect (*1,2,3,4*) in the same cell the
>result is not the same even whitout the Do loop (I
>mean just evaluating this cell several times)
>
>I would be grateful if some can explain what's going
>on here or if there is something wrong with my
>machine.
>
>I worked with Mathematica 4.1 for Linux and Windows.
>
>Best regards
>
>Cesar
>
>
>
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Finance - Get real-time stock quotes
>http://finance.yahoo.com



  • Prev by Date: Re: Integral equations
  • Next by Date: Re: NDSolve with integral equation
  • Previous by thread: Notebook Manipulation
  • Next by thread: Re: Notebook Manipulation