Reviewed and revised December 2023
tab(-10, AG_MESSAGEBOXOK); btnflag; msg, "~"; title; chr(127); Tab(-10,x) Syntax Notes
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.
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
• | EVTMSG.SBX and XTRMSG.SBX in SOSLIB:[907,20] |