Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Updated January 2021; see History

xcall MSGBOX, msg, title, btnflag, iconflag
{, miscflags, rtncde
{, mxflags, timeout, timein, url, iconspec,
    btn1, btn2, btn3, btn4, btn5,
    tip1, tip2, tip3, tip4, tip5,
fontface, fontscale, fgc, bgc}}

Note that in the syntax shown above, spaces and line breaks have no meaning—i.e., they do not and should not exist in the actual program. They are used here strictly as visual aides to illustate the structure of the commands.

MSGBOX displays a message in a popup dialog, with a variety of standard or customized response button options. Depending on the environment and parameter options, one of four implementations may be used:  

Standard Windows Message Box. Used in GUI environments prior to A-Shell 6.3.1543 or when no extended options are requested.
Enhanced A-Shell Message Box using a dialog built with the AUI_CONTROL API. Used in A-Shell 6.3.1543 and later GUI environments when the mxflags parameter is specified.
INMEMO free-form menu. This is used in plain text environments or when forced with the MBX_FRCTXT flag.
HTML. In CGI mode, the message is simply sent to the browser in HTML format as the CGI response.

Parameters

 

Examples

Standard Abort/Retry/Ignore message box in both GUI and plain text versions:

xcall MSGBOX, "Best man tried on ring, can't get it off!", "Wedding Crisis", 2, &h0030, 0, rtncde

ashref_img174     ashref_img175

 

Enhanced version with custom buttons, hyperlink colors...

msg$ = "Obamacare repealed - how do you want to pay? (Click link below to complain)"

title$ = "Emergency Room Cashier Encounter" 

link$ = "<a href="http://www.whitehouse.gov">White House</a>"

icon$ = "first_aid::ashico1"

btn1$ = "Cash" : btn2$ = "Medicare" : btn3$ = "Private Ins"  : btn4$ = "" : btn5$ = ""

tip1$ = "If you got it"  : tip2$ = "Ages 65+ only" : tip3$ = "If you can afford it"

font$ = "" 

fontscale = 150

bgc = &hddddff    ! pink background

xcall MSGBOX, msg$, title$, 0, 0, 0, rtncde, 0, 0, 0, link$, icon$, btn1$, btn2$, btn3$, btn4$, btn5$, tip1$, tip2$, tip3$, tip4$, tip5$, font$, fontscale, fgc, bgc

 

Enhanced version with icon buttons...

title$ = "Music Player"

msg$  = "Current selection: "+chr(13)+chr(13) "I've been working on the A-Shell..."

icon$ = "music::ashico1"

link$ = ""

btn1$ = "media_beginning::ashico1" : btn2$ = "media_rewind::ashico1" : btn3$ = "media_play::ashico1" 

btn4$ = "media_fast_forward::ashico1" : btn5$ = "media_end::ashico1"

tip1$ = "beginning" : tip2$ = "rewind" : tip3$ = "play" : tip4$ = "fast forward" : tip5$ = "end"

font$ = "Comic Sans MS"

fontscale = 200

xcall MSGBOX, msg$, title$, 0, 0, 0, rtncde, 0, 0, 0, link$, icon$, btn1$, btn2$, btn3$, btn4$, btn5$, tip1$, tip2$, tip3$, tip4$, tip5$, font$, fontscale

 

Comments

Standard vs custom buttons: the original version of the message box offered several standard sets of buttons (OK, YES/NO, etc) as specified by the btnflag parameter, and returned a code unique to each button's meaning, rather than its position. So MBRC_CANCEL means the same regardless of whether the CANCEL button was in the 2nd or 3rd position. The enhanced version allows you to specify an arbitrary set of up to 5 buttons, and gives you the choice of treating those as substitutes for the standard button labels, still using the MBRC_xxx rtncde values, or as totally arbitrary buttons (identified by button position in rtncde values 101-105), based on the mxflag MBX_RCBTNO flag. For example, if you set btnflag to MBTN_YES_NO, but specify btn1="Good" and btn2="Bad", unless you set the MBX_RCBTNO flag, the "Good" button will act as the YES button (returning MBRC_YES) and the "Bad" button will act as NO (returning MBRC_NO). This might make sense in some cases, but in general it will probably be best to explicitly set the MBX_RCBTNO flag to return the button number (101 thru 105) when using customized labels. There are two cases where the MBX_RCBTNO flag will be implicitly set. The first occurs when the number of custom buttons defined is more than the number in the standard set as specified by btnflag. In that case, the additional buttons will always return the position code (101-105). The second occurs when btnflag is set to zero and more than one custom button label is defined (i.e. when btn2 is non empty). Although btnflag value zero is equivalent to MBTN_OK, it seems clear that if two or more custom buttons are defined, the intended meaning of btnflag zero is not MBTN_OK but "custom buttons only". This allows you to leave both btnflag and mxflag at zero with a set of custom buttons while avoiding the confusion of the first button returning MBRC_OK while the other buttons return values 102 thru 105.

Aside from the features documented above, an advantage of the enhanced message box is that although it forces you to respond to the message box before returning to the application (i.e. it is task modal), it allows you to access the A-Shell menu bar, for example, to use the Print Screen utility.

See Also

History