Utilities

messagebox

Shows a native message box and returns the clicked button id.

Syntax

messagebox(text: string, caption: string, type: integer): integer

Arguments

NameTypeDescription
textstringText value used by the operation.
captionstringWindow title shown on the message box.
typeintegerMessage box style and button configuration.

Returns

NameTypeDescription
buttonintegerIdentifier for the button clicked by the user.

Description

Shows a native message box and returns the clicked button id.

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

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

Example

Example call with placeholder values.

local result = messagebox("example", "example", 1)
print(result)