BBjMsgBox::show

Description

In BBj 25.03 and higher, this method shows the BBjMsgBox dialog and waits for the user to make a selection.

Syntax

Return Value Method
int show()

Parameters

None.

Return Value

For BBjMsgBox dialog types 0 through 5, the value returned by BBjMsgBox::show identifies which button the user selected, as follows:

Value BBjMsgBox Constant Button Selected
1 MSGBOX_RETURN_OK OK
2 MSGBOX_RETURN_CANCEL Cancel
3 MSGBOX_RETURN_ABORT Abort
4 MSGBOX_RETURN_RETRY Retry
5 MSGBOX_RETURN_IGNORE Ignore
6 MSGBOX_RETURN_YES Yes
7 MSGBOX_RETURN_NO No

For a custom message box (function type 7), the returned value corresponds to the button number, as follows:

Value Button Selected
1 First Button
2 Second Button
3 Third Button

For function type 1 (OK and Cancel), 3 (Yes, No and Cancel) or 5 (Retry and Cancel), if the user closes the message box by hitting the Esc key or by clicking the close box, the effect is the same as if the user clicked the Cancel button; the return value is 2.

For function type 0 (OK) or 7 (Custom), if the user closes the message box by hitting the Esc key or by clicking the close box, the return value is 0 to indicate that no selection was made.

For function type 2 (Abort, Retry, Ignore) or 4 (Yes, No), the user must select one of the buttons; the message box cannot be closed by hitting the Esc key or by clicking the close box.

If a timeout option was specified and the user made no selection within the specified number of seconds, the return value is -1.

Example

msgbox! = bbjapi().msgbox("OK/Cancel")
msgbox!.options(BBjMsgBox.MSGBOX_BUTTONS_OK_CANCEL)
print msgbox!.show()

See Also

BBjAPI

MSGBOX() Function

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.