# AG\_MESSAGEBOXOK
> [HTML Version](ag_messageboxok.htm)
_Reviewed and revised December 2023_
**tab(-10, AG\_MESSAGEBOXOK); btnflag; msg, "~"; title; chr(127);** [Tab(-10,x) Syntax Notes](ag_xxx_syntax-notes.htm.md)
AG\_MESSAGEBOXOK (4) displays a message in a dialog box that is positioned along the bottom couple of lines of the window, as shown below. This may be considered a GUI approximation of the standard MESAG subroutine.
**(./images/ashref_img35.png)**
**Parameters**
_btnflag_
A single character which must be a space (ASCII 32) to display just an OK button in the dialog, or an exclamation point (ASCII 33) to display both OK and CANCEL buttons
_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 which button was pushed: ESCAPE (ASCII 27) for the Cancel button, RETURN (ASCII 13) for the OK button.
**Example**
map1 btnflag,s,1
map1 msg,s,80
map1 title,s,80
map1 x,b,1
btnflag = "\!" \! OK and Cancel buttons
msg = "Please make sure checks are aligned before printing."
title = "Printer Check"
? TAB(-10,AG\_MESSAGEBOXOK); btnflag; msg; "~"; title; chr(127);
xcall ACCEPN, x
if x = 27 ? "Cancel"
if x = 13 ? "OK" ? TAB(-10,AG\_MESSAGEBOXOK);"\!Make sure you have a backup before posting\!"; ~Read This\!";chr(127);
**Notes**
MSGBOX a similar but more flexible and powerful implementation in subroutine form. The main advantage of AG\_MESSAGEBOXOK is that it could be issued from an arbitrary server (not running A-Shell), provided the client was ATE.
**See Also**
• [MSGBOX](msgboxsbr.htm.md)[xs](keyword-types.htm.md)
• EVTMSG.SBX and XTRMSG.SBX in [SOSLIB:\[907,20\]](https://bitbucket.org/microsabio/soslib/src/master/907020)