[Date Index] [Thread Index] [Author Index]
Re: "Freezing" evaluation Output?
AES wrote: > [I hope people will pardon the ongoing barrage of perhaps absurd > questions I keep posting; the answers are appreciated, and sometimes > even useful.] > > Is there any simple programmable way to "freeze" the Output from the > evaluation of an Input cell, so that subsequent reevaluation of the > Input cell doesn't end by erasing the previous output? > > E.g., I evaluate a plotting routine that takes a long time to do all its > calculations, and I want to be sure I keep the resulting graphic around > until I'm ready to delete it. > > I appreciate there are simple ways to do this "manually": > > 1) Insert (by hand) a dummy text cell between the Input and Output > cells. > > 2) Export the Output to somewhere else, with a file name that contains > an execution-time-dependent string. > > 3) Other similar approaches requiring "operator intervention". > > But is there an execution (or output) option for Input cells (or for > individual commands) that says, "Don't replace previous output, even if > it's still there"? It is the Cell-Option CellAutoOverwrite which controles whether a cell is replaced or not. You can test that with: CellPrint[Cell["test","Output",CellAutoOverwrite->False]] which should behave as you suggested. CellAutoOverwrite is usually set to True for Output, Message, Print and Graphics cells in the common stylesheets, I think. If you want to not overwrite e.g. Graphics-Cells you could change CellAutoOverwrite to False for Graphics-Cells in the StyleSheet you are using. Since this is most probably something that you don't want globally, you might need some extra work and write special routines that generate the Cells you want to output, put CellAutoOverwrite to False for them and write them to your notebook with CellPrint. You might need to learn about functions like MakeBoxes and DisplayString to generate Cells containing formatted expressions, graphics, etc. Maybe there are simpler ways to achieve this, but these I don't know.... hth, albert