【问题标题】:TI-Basic Dialog show more textTI-Basic 对话框显示更多文本
【发布时间】:2014-11-06 03:06:15
【问题描述】:

我的 TI-89 Titanium 上有一个显示文本的程序。它工作正常,直到文本变得太长,我得到“错误:维度”。我该如何规避这种情况,或者将文本拆分为多个对话框?

这是一个例子:

Text "A short string that fits." Text "A very long string that will not fit on a normal dialog!"

【问题讨论】:

  • 如果你能分享你的代码和更多关于你在做什么的细节会很有帮助吗?谢谢!

标签: messagebox ti-basic


【解决方案1】:

我建议使用DialogEndDialog 命令而不是TextText 可以简单地处理一行不超过 37 个字符的行,但实际上通常超过 30 个字符会从拨号中跑出并且不可见。 DialogEndDialog 更健壮很多,它可以采用Title 和多行TextRequestDropDown。这是一个例子:

:Dialog
: Title "Some title text"
: Text "Some informational text"
: Text "Another line of informational text"
:EndDialog

如上所述,您也可以使用RequestDropDown 行。

如果您有一个包含可变长度字符串的变量要显示,您可以执行以下操作:

:"String that is too long to fit on one line."→txt
:Dialog
: Title "Some title text"
: Text left(txt,30)
: Text right(txt,dim(txt)-30)
:EndDialog

left(str,n) 将返回str 的最左边的n 字符,同样right(str,n) 将返回str 的最右边的n 字符。 Dim(str) 将返回 str 中的字符数。

您可以阅读有关DialogEndDialog here 的更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-13
    相关资源
    最近更新 更多