Message Boards Message Boards

1
|
4870 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

[Solved] Using a button to delete an output

Hi,

I created a little code to show my problem.

Manipulate[
 x + 1,
 Column[{
   Control@{x, 0, 9, 1},
   Button["Delete this application", "???"]
   }]
 ]

How do I delete the application output using the button? You cannot use "out [n]" for this, because when you run the code again, "n" changes its value.

I'll appreciate any help. Anderson

POSTED BY: Anderson Gaudio
4 Replies

This should do the job:

Button["Delete this application", NotebookDelete@EvaluationCell[]]
POSTED BY: Kuba Podkalicki

Dear Kuba, Your code solved the problem. Thank you very much.

Best regards, Anderson

POSTED BY: Anderson Gaudio

Anderson,

This button will delete all output cells and reset a notebook:

Button["Reset Notebook", FrontEndExecute[
     FrontEndToken["DeleteGeneratedCells"]]]

Regards,

Neil

POSTED BY: Neil Singer

Dear Neil,

The notebook where the real application is inserted contains other applications whose results are used here and there. If all the outputs are erased, unfortunately there will be data loss. Thanks a lot, Anderson

POSTED BY: Anderson Gaudio
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract