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$

closed as off-topic by MarcoB, m_goldberg, user9660, Kuba, Edmund Jun 1 '16 at 9:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, m_goldberg, Community, Kuba, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

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