SmartBear
The MessageDlg function displays a dialog box with the specified message and buttons.
MessageDlg
BuiltIn.MessageDlg(Param1, Param2, Param3, Param4)
The method is applied to the following object:
BuiltIn
The method has the following parameters:
Param1
The message to be displayed.
Param2
Indicates the message box type. It can be any of the following constants:
mtWarning
mtError
mtInformation
mtConfirmation
mtCustom
Param3
Specifies the buttons to be displayed in the message box. This parameter can be any combination of the following values:
mbYes
mbAll
mbNo
mbYesToAll
mbOK
mbNoToAll
mbCancel
mbHelp
mbAbort
mbYesNoCancel
mbRetry
mbOKCancel
mbIgnore
mbAbortRetryIgnore
To specify the Param3 parameter, you should create a set value using the MkSet function (see the example below). Use of MkSet is obligatory. You are not allowed to skip it.
MkSet
Param4
This parameter is reserved.
The MessageDlg function returns one of the constants that indicates which button the user pressed in the message box:
mrYes
mrAll
mrYesToAll
mrNo
mrAbort
mrNoToAll
mrOK
mrRetry
mrCancel
mrIgnore
The following code demonstrates calling the MessageDlg function in scripts:
VBScriptCopy Code
Sub TestDialog i = MkSet(mbYes, mbYesToAll, mbNo, mbCancel) i = MessageDlg("Message text", mtConfirmation, i, 0)End Sub
JScriptCopy Code
function TestDialog() { var i; i = MkSet(mbYes, mbYesToAll, mbNo, mbCancel); i = MessageDlg("Message text", mtConfirmation, i, 0); }
DelphiScriptCopy Code
procedure TestDialog;var i : OleVariant;begin i := MkSet(mbYes, mbYesToAll, mbNo, mbCancel); i := MessageDlg('Message text', mtConfirmation, i, 0);end;
C++Script, C#ScriptCopy Code