Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Oleksandr R., m_goldberg, Sjoerd C. de Vries, Ajasja, rm -rf Feb 13 '13 at 20:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Have you tried adjusting $HistoryLength? –  Verbeia Feb 12 '13 at 7:43
4  
A bit more information on what your function actually does and how it is implemented would be very useful. –  Yves Klett Feb 12 '13 at 9:57
    
@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 –  MLD Feb 12 '13 at 23:56
    
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... –  Albert Retey Feb 13 '13 at 1:20
1  
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. –  John Fultz Feb 13 '13 at 2:29
show 2 more comments

Browse other questions tagged or ask your own question.