2
$\begingroup$

This question already has an answer here:

I have an output which I want to hide if there is an error otherwise display it. The output is a Dynamic[output] so I can't simply use something like

If[IntegerQ[output],output,""]

or

If[Head[output]==Integer,output,""]

becasue it seems that although this method would work for other items such as integers, text and so on, a dynamic object stays a dynamic object whether there is an error or not. What I am looking for is something that does the following

If there is an error occuring when I display this dynamic object, display nothing otherwise display the dynamic object.

I have tried the Check and Quiet functions together and what I get is below. I don't care about the typed error messages but I'm talking about the output cells that look like red blocks with writing inside of them. I hope this explains things better. I have put a picture instead of code becasue there are a lot of background definitions for all the things in the grid that would be too long to put here.

Check and Quiet

$\endgroup$

marked as duplicate by Kuba, bobthechemist, rm -rf May 1 '14 at 19:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ There is a whole lot of code defining all this stuff. I posted the picture so you could see the results without having to look at all the background code. $\endgroup$ – lara Jan 30 '14 at 9:57
  • 1
    $\begingroup$ Related: (29085), (29086) $\endgroup$ – Mr.Wizard Jan 30 '14 at 9:59
  • $\begingroup$ @LaraJordan So please create a minimal working example. $\endgroup$ – Kuba Jan 30 '14 at 10:01
  • $\begingroup$ Thanks Mr. Wizard. It is definately a case of one of these 'front end' error messages so likely nothing normal to supress kernel error messages will work. $\endgroup$ – lara Jan 30 '14 at 10:13
  • $\begingroup$ You're welcome. I wish I had more to offer. $\endgroup$ – Mr.Wizard Jan 31 '14 at 5:29