When used in web apps:
Calling MessageBox in a session displays the dialog box. Unlike with desktop, this call is not synchronous.
Calling MessageBox outside a session depends on whether you are running from a built app or from the IDE:
Running in a built app: It prints the message to the console just like a console app.
Running from the IDE: It displays the message in the IDE's message pane.
When used in mobile apps:
MobileMessageBox.Message = message
Displays message in a browser dialog with a single OK button.
When used in console apps:
Works the same as Print. The message is output to the console/terminal.
When used in desktop apps:
Any valid string expression.
In desktop and web apps, if the message contains two EndOfLine characters back-to-back, the text that precedes them will be displayed larger, bold font style while the text that follows will be displayed in a smaller, plain font style.
You should avoid using MessageBox for displaying debugging messages. The displaying of the Message Box will alter event order and may give unexpected results. Instead use the Debugger, System.DebugLog or your own logging mechanism.
A message can be presented to the user with either the MessageBox method or the MessageDialog class. The MessageBox method is recommended for simple informational messages only. For other situations, the MessageDialog class is more appropriate. It enables you to add up to three buttons, label them in any way, and take any action after the user clicked a button.
The Message box opened by MessageBox has a Title bar. On Windows, the dialog also has a Close widget in its Title bar. The dialog can be closed either by clicking OK or clicking the Close widget. On Windows and Linux, the width increases to accommodate the longest paragraph. On Macintosh, the Message box has a fixed width and the text word-wraps to fit the width of the MessageBox.
Multiple paragraphs can be passed in the message parameter by separating each paragraph with the EndOfLine function.
Closing a MessageBox gives the focus back to the window, which calls its Activated event.
On macOS only the Caution icon is displayed. This is the result of changes made by Apple in HID specs. See here for details.
The MessageBox buttons are not localized — this is a known bug (feedback report 4665).
This code displays a one line Message box.
The following desktop or web code displays a multiline Message box. The text after the two EndOfLine function calls appears in plain type with a smaller font size. Please note that it is entered as one line in the Code Editor.
MessageBox("Please enter all your credit card info, bank accounts, and trust funds before proceeding to run my shareware application." _
+ EndOfLine + EndOfLine + "Any additional voluntary contributions are gratefully accepted.")
All project types on all supported operating systems.