语法
messagebox(text: string, caption: string, flags: number): integer参数
| 名称 | 类型 | 描述 |
|---|---|---|
text | string | 直接传给 Windows message box 的消息 text。 |
caption | string | 直接传给 Windows message box 的 caption string。 |
flags | number | 通过 integer conversion 转换并直接传给 Windows message box 的数值 flags。 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
result | integer | Windows Windows message box 调用返回的 integer 结果代码。 |
说明
通过 a yielding operation 调用 Windows message box 来显示 Windows Windows message box,然后返回 Windows message box 产生的 integer 结果代码。text 和 caption 必须是 string,flags 必须是 number。flags 会通过 integer conversion 转换并直接传给 Windows message box。无效的参数类型会触发实现中的 type checking 错误。没有注册 alias。
使用 3 个参数调用: text, caption, flags。参数表会说明哪些值必填,哪些值只用于细化行为。
返回 result (integer)。使用返回表区分成功值、nil 结果和可恢复错误。
示例
Show a Windows message box and read the integer result code returned by the dialog.
local result = messagebox("Real is ready.", "Real", 0)
print(result)