Miscellaneous

messagebox

Shows a Windows message box with text, caption, and numeric flags, then returns the integer result code.

语法

messagebox(text: string, caption: string, flags: number): integer

参数

名称类型描述
textstringMessage text.
captionstringWindow caption.
flagsnumberNumeric message box flags.

返回值

名称类型描述
resultintegerInteger result code returned by the message box.

说明

Shows a Windows message box with text, caption, and numeric flags, then returns the integer result code.

使用 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)