# AG\_MESSAGEBOXSTD
> [HTML Version](ag_messageboxstd.htm)
_Reviewed and revised December 2023_
**tab(-10, AG\_MESSAGEBOXSTD); flag1; flag2; msg; "~"; title; chr(127);** [Tab(-10,x) Syntax Notes](ag_xxx_syntax-notes.htm.md)
AG\_MESSAGEBOXSTD (17) displays a standard Windows message box dialog, which consists of a title bar, text message (up to 1024 characters) and a set of buttons as in the following example. Note how different versions of Windows produce different versions of the dialog, with no changes to the A-Shell code.
| | |
|------|------|
| **(./images/ashref_img37.png)** | **(./images/ashref_img38.png)** |
Note that [MSGBOX](msgboxsbr.htm.md)[xs](keyword-types.htm.md) provides a more convenient interface to this function, and offers the additional bonus of detecting if the environment doesn’t support GUI functions, implementing the message box in text mode via [INMEMO](inmemo_sbr.htm.md)[xs](keyword-types.htm.md) if necessary.
**Parameters**
_flag1_
A single character whose ASCII value is 32 plus the sum of a single choice from each of the following two tables (a button choice and an icon choice):
| **Value** | **Button Option** |
|------|------|
| 0 | OK button |
| 1 | OK and CANCEL buttons |
| 2 | ABORT / RETRY / IGNORE buttons |
| 3 | YES / NO / CANCEL buttons |
| 4 | YES /NO buttons |
| 5 | RETRY / CANCEL buttons |
| **Value** | **Icon Option** |
|------|------|
| 16 | ICON: "X" (stop) |
| 32 | ICON: "?" (question) |
| 48 | ICON: "\!" (exclamation) |
| 64 | ICON: "i" (information) |
For example, the sample message dialog above would have set the _flag1_ parameter to chr(32+2+48)
_flag2_
A single character whose ASCII value is 32 plus the sum of zero or more options from the following table:
| **Value** | **Description** |
|------|------|
| 1 | Default is button #2 |
| 2 | Default is button #3 |
| 4 | Dialog is task modal |
| 8 | Dialog is system modal |
| 64 | Add a help button |
_msg_
A text string containing the message to display in the body of the dialog.
_tilde_
A single, literal tilde character ( ~ ).
_title_
A text string to be displayed on the title bar of the dialog.
**Response**
A single byte indicating how the dialog was exited, according to the following table:
| **Return Char** | **Description** |
|------|------|
| 33 | OK |
| 34 | Cancel |
| 35 | Abort |
| 36 | Retry |
| 37 | Ignore |
| 38 | Yes |
| 39 | No |
| 40 | A |
| 41 | Help |
**Example**
\! simple test of AG\_MSGBOXSTD (from doc)
\++include ashinc:ashell.def
MAP1 A,F
? TAB(-10,AG\_MESSAGEBOXSTD);chr(32+2+48);chr(32+1+4); \&
"Best man tried on the bride's ring.";chr(13); \&
"Now he can't get it off.~Wedding ceremony crisis.";chr(127);
xcall ACCEPT,A \! receive response (see notes below)
END
**Comments**
Unlike the OK/Cancel Message Dialog (-10,4),which appears as a short but wide dialog along the bottom of the window, this one is more rectangular and appears in the middle of the screen. Also, unlike the OK/Cancel dialog which is really only suitable for single-line messages, this one can handle up to 1024 characters. You can break the lines explicitly, as in the example above, with a chr(13), or you can rely on the routine itself to break the lines as it sees fit.
**See Also**
• [AG\_MESSAGEBOX](ag_messagebeep.htm.md)
• [MSGBOX](msgboxsbr.htm.md)[xs](keyword-types.htm.md)
• EVTMSG.SBX and XTRMSG.SBX in the [SOSLIB:\[907,20\]](https://bitbucket.org/microsabio/soslib/src/master/907020)