MathGroup Archive 2000

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

Search the Archive

Progress Meter

  • To: mathgroup at
  • Subject: [mg25338] Progress Meter
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Sat, 23 Sep 2000 03:36:03 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Roberto Brambilla wanted to know how he could see get a nice indication of
how a program is making progress.
Theodore Gray (of Wolfram Research) showed how this can be done very nicely
in Volume 7, Issue 3 of  The Mathematica Journal.  Using T. Gray's solution
you first evaluate the line below.  

ShowStatus[status_] := LinkWrite[$ParentLink, 
   SetNotebookStatusLine[FrontEnd`EvaluationNotebook[], ToString[status] ]


Now suppose  i=8 and j=12.  Evaluating the next two lines will cause "i=8,
j=12" to show in the lower left portion of the Mathematica Window.  Well
that's provided the notebook you are using has a setting for the
WindoeElements option to show the "StatusArea" which is done the default
Style Sheet does.

progress=StringJoin[ "i=", ToString[i], ", j=", ToString[j] ];


What Roberto Brambilla was doing is evaluating a Print statement over and
over. After the program ran he had a lot of Print statements to manually
delete. Evaluating the code below will delete all cells in the input
notebook that were 
generated by Print statements.

NotebookFind[nb, "Print", All, CellStyle];

Ted Ersek

Down Load Mathematica tips, tricks from

  • Prev by Date: filtering data
  • Next by Date: RE: matrix indices
  • Previous by thread: Re: filtering data
  • Next by thread: Optimizing a simple sampling function for speed