Difference between revisions of "MESSAGEBOX()"
From Lianjapedia
Helen.george (Talk | contribs) |
Helen.george (Talk | contribs) |
||
Line 11: | Line 11: | ||
The MESSAGEBOX() function is used to display a dialog box with user-defined elements. The message, title, icon and buttons can all be defined. | The MESSAGEBOX() function is used to display a dialog box with user-defined elements. The message, title, icon and buttons can all be defined. | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=15%|Parameters||width=15%|Required||width=15%|Default||Description | + | !width="15%"|Parameters||width="15%"|Required||width="15%"|Default||Description |
|- | |- | ||
|<expC1>||Yes||None||The message to display in the message box. | |<expC1>||Yes||None||The message to display in the message box. | ||
|- | |- | ||
− | |valign=top|<expN>||No||0||A number representing the buttons and icon to include in the message box and the specification of the default button. See the tables below for details. | + | |valign="top"|<expN>||No||0||A number representing the buttons and icon to include in the message box and the specification of the default button. See the tables below for details. |
|- | |- | ||
|<expC2>||No||Lianja||The title of the message box. | |<expC2>||No||Lianja||The title of the message box. | ||
Line 24: | Line 24: | ||
====Buttons==== | ====Buttons==== | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=15%|Value||Buttons | + | !width="15%"|Value||Buttons |
|- | |- | ||
|0||Ok | |0||Ok | ||
Line 43: | Line 43: | ||
====Icons==== | ====Icons==== | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=15%|Value||Icon | + | !width="15%"|Value||Icon |
|- | |- | ||
|16||Stop road sign | |16||Stop road sign | ||
Line 59: | Line 59: | ||
====Default==== | ====Default==== | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=15%|Value||Buttons | + | !width="15%"|Value||Buttons |
|- | |- | ||
|0||First button | |0||First button | ||
Line 75: | Line 75: | ||
The MESSAGEBOX() function returns a number signifying the selected button: | The MESSAGEBOX() function returns a number signifying the selected button: | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=15%|Return Value||Buttons | + | !width="15%"|Return Value||Buttons |
|- | |- | ||
|1||Ok | |1||Ok |
Revision as of 12:57, 1 February 2013
Contents
Purpose
Function to display a dialog box with user-defined elements
Syntax
MESSAGEBOX(<expC1> [, <expN> [, <expC2>]])
See Also
Description
The MESSAGEBOX() function is used to display a dialog box with user-defined elements. The message, title, icon and buttons can all be defined.
Parameters | Required | Default | Description |
---|---|---|---|
<expC1> | Yes | None | The message to display in the message box. |
<expN> | No | 0 | A number representing the buttons and icon to include in the message box and the specification of the default button. See the tables below for details. |
<expC2> | No | Lianja | The title of the message box. |
Buttons
Value | Buttons |
---|---|
0 | Ok |
1 | Ok and Cancel |
2 | Abort, Retry and Ignore |
3 | Yes, No and Cancel |
4 | Yes and No |
5 | Retry and Cancel |
Icons
Value | Icon |
---|---|
16 | Stop road sign |
32 | Question mark |
48 | Exclamation mark |
64 | Information sign |
Default
Value | Buttons |
---|---|
0 | First button |
256 | Second button |
512 | Third button |
The <expN> is the sum of the values to be specified, one from each table. For example, if <expN> is 292, the message box will have Yes and No buttons (4), a Question mark icon (32) and the second button (No) will be the default (256).
Return Values
The MESSAGEBOX() function returns a number signifying the selected button:
Return Value | Buttons |
---|---|
1 | Ok |
2 | Cancel |
3 | Abort |
4 | Retry |
5 | Ignore |
6 | Yes |
7 | No |
For message boxes that include the Cancel button, pressing the Escape key will also cause the MESSAGEBOX() function to return 2.
Example
nReturn = messagebox("Are you sure?", 36, "Continue to next screen") if nReturn = 6 // user selected 'Yes', process accordingly else // user selected 'No', process accordingly endif