ShowMessage()
Summary
Shows a message in a standard Windows message box.
Syntax
ShowMessage(string message, array argv, array options)
| Argument | Type | Contents |
|---|---|---|
| message | String | The message to be displayed |
| argv | Array | An array of values to replace the format specifiers in the message |
| options | Array | An array specifying additional options. See table below |
| Option | Type | Contents |
|---|---|---|
| Literal | Boolean | Iftrue, the message is not translated. Iffalse(default), the message will be translated before substitutions are applied. |
| Caption | String | Text to display in the message. Default is "Note" |
Notes
-
The message box includes an OK button that closes the box when clicked.
-
Use "\n" to insert line breaks in the message text.
-
If translation is enabled, the message will be translated before format substitutions occur.
-
You can use numbered placeholders like
%1,%2, ...,%9to insert values from theargvarray in a flexible order.
Example
// Basic message
if result = null then ShowMessage("There was no result!")
else ShowMessage("The result was " + result)
// Multi-line message
ShowMessage("First line." + "\n" + "Second line.")
// Using format specifiers
argv ={"Customers", 10}
msg1 = "%2 %1 were found"
ShowMessage(msg1, argv) // Displays: "10 Customers were found"
// Reordering arguments
msg2 = "%1 found: %2"
ShowMessage(msg2, argv) // Displays: "Customers found: 10"
See Also
| Function | Summary |
|---|---|
| ShowArray() | Displays a Windows dialog box containing the contents of an array, including nested sub-arrays |
| String() | Converts a real number to a string |
| GetLastError() | Gets the text of the last error generated by the platform |
| TaskDialog() | Creates an enhanced version of a standard Windows Message |
| GetText() | Generates a formatted string. |