Lets say I have a calculation in a form of
Table[myStuff[i],{i,0,k}]
Is there a way to avoid a fixed k but instead end the loop after an abitrary amount of time with an user input.
Such that I can start the calculation in the evening and just stop it in the morning without having to estimate a k.

Table[myStuff[i], {i, 0, Dialog[]}]? – Michael E2 Oct 23 '16 at 21:07i = 0; While[i < Infinity, myStuff[i]; i++]; after aborting you can geti. You'd have to figure out how do you want to store the values ofmyStuff[i](I don't know in detail what are you doing so this is just a hint), but it might turn out to be inefficient. – corey979 Oct 23 '16 at 21:36