Difference between revisions of "MESSAGEBOX()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) (→Description) |
||
Line 25: | Line 25: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !Value||Buttons | + | !width=50%|Value||Buttons |
|- | |- | ||
|0||Ok | |0||Ok | ||
Line 44: | Line 44: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !Value||Icon | + | !width=50%|Value||Icon |
|- | |- | ||
|16||Stop road sign | |16||Stop road sign | ||
Line 60: | Line 60: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !Value||Buttons | + | !width=50%|Value||Buttons |
|- | |- | ||
|0||First button | |0||First button | ||
Line 76: | Line 76: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !Return Value||Buttons | + | !width=50%|Return Value||Buttons |
|- | |- | ||
|1||Ok | |1||Ok |
Revision as of 11:18, 10 February 2012
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 | Recital | 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