messagebox
Displays a message box dialog.
messagebox(text: string, caption: string, flags: number) -> number
| Parameter | Type | Description |
|---|
text | string | The message text |
caption | string | The window title |
flags | number | Button and icon flags |
| Type | Description |
|---|
number | The button pressed by the user |
messagebox displays a Windows-style message box with customizable buttons and icons.
| Flag | Description |
|---|
0 | OK button |
1 | OK + Cancel |
4 | Yes + No |
16 | Error icon |
32 | Question icon |
48 | Warning icon |
64 | Info icon |
| Value | Description |
|---|
1 | OK |
2 | Cancel |
6 | Yes |
7 | No |
-- Simple message
messagebox("Hello!", "Greeting", 0)
-- Confirmation dialog
local result = messagebox("Are you sure?", "Confirm", 4 + 32)
if result == 6 then
print("User clicked Yes")
else
print("User clicked No")
end
-- Warning message
messagebox("Something went wrong!", "Warning", 0 + 48)
- Flags can be combined with addition
- This is a yielding function