Miscellaneous

messagebox

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

Syntax

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

Arguments

NameTypeDescription
textstringMessage text.
captionstringWindow caption.
flagsnumberNumeric message box flags.

Returns

NameTypeDescription
resultintegerInteger result code returned by the message box.

Description

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

Call it with 3 parameter(s): text, caption, flags. The argument table explains which values are required and which ones only refine the behavior.

It returns result (integer). Use the returns table to separate successful values from nil results and recoverable errors.

Example

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)