I'm trying to abort a While
cycle, with a dialog box. I've tried the following:
res = 0;
res2 = "";
CreateDialog[{TextCell["Do you want to continue calculations?"],
Button["Proceed", DialogReturn[res2 = True]],
Button["Cancel", DialogReturn[res2 = Abort[]]]}];
While[True , res++; If[res > 10, res = -1]; res2];
However, this does not work. It's important that the Dialog
window may be left opened while the While
continues to 'work'.
I've tried this but I was unable to adapt that solution to my problem...
Any help would be appreciated.