Tag Info

New answers tagged


On[Assert] $AssertFunction := ( (*1*) SelectionMove[EvaluationNotebook[], All, Notebook, AutoScroll -> False]; FrontEndExecute @ FrontEndToken @ "RemoveFromEvaluationQueue"; SelectionMove[EvaluationCell[], After, Cell, AutoScroll -> False]; (*2*) RunScheduledTask[$Pre =., {1}]; $Pre = Abort[] &; ...


It sounds like you want to inspect the stack when an assertion fails. Will Dialog do what you want? As in $AssertFunction:=Dialog[] As already mentioned however, cells queued for evaluation, and even subsequent lines in the current cell, will still execute when you Return or ExitDialog. You can ExitDialog[Unevaluated[Abort[]]] to abort a statement, but ...

Top 50 recent answers are included