1
$\begingroup$

I have made a simple "percent complete" output to track my For loop, where I incrementally print values and then delete the output right before printing the next value. I want the output to remain on a single line, just as I have it.

startvalue = 1;
stopvalue = 70;
For[n = startvalue, n <= stopvalue, n++,
  If[Mod[(n - startvalue), 10] == 0,
    NotebookFind[SelectedNotebook[], "PrintTemporary", All, CellStyle];
    NotebookDelete[];
    PrintTemporary[
      StringJoin[
        "Percent Complete: ", 
        ToString[Round[(n-startvalue)*100/(stopvalue - startvalue), 0.1]]]]
  ]
]

What's annoying me is that every time PrintTemporary is output, the Mathematica window adjusts to put the output in view. Basically, every few seconds, my screen keeps jumping back to this For loop. How do I make it stop readjusting every time something is printed? I have looked at PrintAction and EvaluationCompletionAction but am not having any luck.

$\endgroup$
  • 2
    $\begingroup$ Have you looked into Monitor? $\endgroup$ – wxffles May 27 '16 at 1:12