Arbortext Command Language > Functions by Alphabetical Listing > message_box
  
message_box
message_box (message, flags[, title])
This function displays a message box with the text message and optional title title. The flags parameter determines what predefined buttons and icons display in the message box, and is formed by ORing the flags from the following groups of flag bits.
Specify one of the following flags to indicate the buttons that will display in the message box:
0x00 — Display OK button only. This is the default.
0x01 — Display OK and Cancel buttons.
0x02 — Display Abort, Retry, and Ignore buttons.
0x03 — Display Yes, No, and Cancel buttons.
0x04 — Display Yes and No buttons.
0x05 — Display Retry and Cancel buttons.
Specify one of the following flags to indicate the icon to display in the message box. If you do not specify one of these flags, an icon does not display.
0x10 — Display the Error (Stop) icon. This icon is typically used with the Abort, Retry, and Ignore buttons.
0x20 — Display the Question icon. This icon is typically used with the Yes and No buttons.
0x30 — Display the Warning icon.
0x40 — Display the Information icon.
Specify one of the following flags to indicate the default button:
0x000 — The first button is the default. This is the default if no other default button flag is specified.
0x100 — The second button is the default.
0x200 — The third button is the default.
If title is not specified or is a null string, the default title $progname Message is used.
The return value is one of the following:
1 — The first button (Yes, OK, Abort, or Retry) was pressed.
2 — The No button was pressed.
3 — The third button (Cancel or Ignore) was pressed.
If the dialog box has a Cancel or Ignore button, the function returns 3 if the Cancel or Ignore button or ESC key was pressed, or if the dialog box was closed from the Close system menu or Close button. If the dialog box does not have a Cancel or Ignore button and is closed with the ESC key or by the Close system menu or Close button, the function returns 2 if the dialog has only Yes and No buttons. If the dialog box only has an OK button, it returns a 1.
Examples
message_box("Save new file?", 0x03+0x20)
message_box("Document is incomplete.", 0x40, "Incomplete")
Related Topics
response function
message command