Message Boards Message Boards

How to display errors in cells that are wrapped?

Posted 1 year ago

For a large notebook, it is convenient to add sections and wrap codes for easy display. However, I find that when I evaluate a piece of wrapped code by clicking on the vertical bar on the right hand side and press Shift+Enter, if the wrapped code contains error such as false assertion, then, this piece of code is still wrapped, so I cannot see whether there is errors when evaluating the wrapped code.

Hence, is there a way to unwrap and display cells with errors when evaluating wrapped code? Or is there a way to fast locate wrapped cells with errors? Or, at the least, is there a way to know if errors happen when evaluating wrapped code? Thank you.

POSTED BY: Francis Cong
3 Replies
Posted 1 year ago

Or, at the least, is there a way to know if errors happen when evaluating wrapped code?

A practical (I hope) example. Open and save the notebook file attached to this post below somewhere on your PC. Then, in a new notebook, run this code (with a suitable file path):

Attachments:
POSTED BY: Hans Milton
Posted 1 year ago

Thank you. Now I find a partial solution: Add "Beep" to Global Options-MessageOptions-KernelMessageAction. Then, a beep will be triggered if there is an error in wrapped code.

POSTED BY: Francis Cong
Posted 1 year ago

Just a note. Your example code does not trigger a Failed message unless On[Assert] has been evaluated before. Starting with a fresh kernel:

POSTED BY: Hans Milton
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