I want to print a dynamic output while some code is running and then automatically delete it when when the output is done. PrintTemporary is not quite what I am looking for -- I want the output to be deleted from inside the module rather than when the cell is done evaluating because I want to evaluate several modules in the same cell. Here is an example of what I am looking for:
test[steps_]:=Module[{},
n=0;
Print["% Complete: ",Dynamic[n*100/steps]];
For[n=0,n<steps,n++,
(*CODE RUNS*)
];
(*Delete Output Cell*)
]
I want to explicitly delete the output cell created when running test
, but cannot find the commands to do so. All I have seen on stackexchange is how to delete ALL output cells or how to print temporarily, which I do not want.