ErrorBox
ErrorBox[boxes]
是一个底层的框符结构,用于表示输入或输出中不能解释的框符.
范例
打开所有单元 关闭所有单元基本范例 (2)
当检测到不完整的语法时,MakeExpression 会生成 ErrorBox 结构:
MakeExpression["1+", StandardForm]ErrorBox 显示为一个粉红色的框符:
RawBoxes[%]无效的框符参数可能会生成 ErrorBox:
CellPrint[Cell[BoxData[FractionBox["1", "2", "3"]], "Output"]]范围 (3)
属性和关系 (2)
可以用 NotebookRead 读取内核排版生成的 ErrorBox:
CellPrint[Cell[BoxData[MakeExpression["1+", StandardForm]], "Output", CellTags -> "example1"]]NotebookRead[Cells[CellTags -> "example1"]]错误的框符会被显示为一个 ErrorBox,但 NotebookRead 会反映出这是个坏的输入:
CellPrint[Cell[BoxData[SuperscriptBox["1", "2", "3"]], "Output", CellTags -> "example2"]]NotebookRead[Cells[CellTags -> "example2"]]技术笔记
相关指南
-
▪
- 底层笔记本结构
历史
1996年引入 (3.0)
文本
Wolfram Research (1996),ErrorBox,Wolfram 语言函数,https://reference.wolfram.com/language/ref/ErrorBox.html.
CMS
Wolfram 语言. 1996. "ErrorBox." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/ErrorBox.html.
APA
Wolfram 语言. (1996). ErrorBox. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/ErrorBox.html 年
BibTeX
@misc{reference.wolfram_2026_errorbox, author="Wolfram Research", title="{ErrorBox}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ErrorBox.html}", note=[Accessed: 11-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_errorbox, organization={Wolfram Research}, title={ErrorBox}, year={1996}, url={https://reference.wolfram.com/language/ref/ErrorBox.html}, note=[Accessed: 11-September-2026]}