Is there a Front End option (or programming option) in Mathematica 9 that limits the amount of time that functions take to execute? I have a function (as part of a Mathematica Application) that shows page breaks and iterates though each cell of a notebook. The function operated on large notebooks without problem in Mathematica 8, however in Mathematica 9, it reaches a different point of the notebook each time (and almost gets to the end if page breaks are already showing). The function operates without problem on each half of the notebook (and on smaller notebooks). I have not used any TimeConstraint options. Also note, that I am able to execute the function using Workbench (with Mathematica 9).

EDIT The function is to create a table of contents (a slightly modified version of the code given on Stack Exchange: Generating a Table of Contents). It includes cells that are already tagged.

The code is executed via a button.

  • 1
    $\begingroup$ Have you tried adjusting $HistoryLength? $\endgroup$
    – Verbeia
    Commented Feb 12, 2013 at 7:43
  • 4
    $\begingroup$ A bit more information on what your function actually does and how it is implemented would be very useful. $\endgroup$
    – Yves Klett
    Commented Feb 12, 2013 at 9:57
  • $\begingroup$ @Verbeia, Thanks for pointing out $HistoryLength. I did not know of that setting. It was set at Infinity, however changing it to zero did not help $\endgroup$
    – MLD
    Commented Feb 12, 2013 at 23:56
  • $\begingroup$ as you say that the code works if called from the workbench, how exactly are you calling this functions (shift-evaluate, button, ...)? So far (?) I don't know of any global time constraints for shift-evaluation and would be very surprised if such constraints would have been introduced, for other ways to call your code I wouldn't be surprised if some default behavior might have changed... $\endgroup$ Commented Feb 13, 2013 at 1:20
  • 1
    $\begingroup$ The fact that it's in a button is the entire question. None of your code matters. The question could be boiled down to "Why does Button["wait", Pause[20]; Print["done"]] not complete"? The answer to which is that you should add the option Method->"Queued" as an option to the Button. $\endgroup$
    – John Fultz
    Commented Feb 13, 2013 at 2:29


Browse other questions tagged or ask your own question.