msgBox
msgBox(msg: String; title: String; flags: Integer): Integer;
The msgBox method of the Application class displays a message in a dialog and waits for the user to click a button.
When you are working with multiple monitors on one workstation, by default, Microsoft Windows displays a message box on the monitor where the application last had focus.
The msgBox method returns a value indicating the button that the user has clicked. (For details, see "msgBox Method Return Values", later in this section.)
The msgBox method parameters are listed in the following table.
Parameter | Description |
---|---|
msg | Specifies the message displayed in the dialog |
title | Specifies the dialog title |
flags | Specifies the buttons and icons that are to be displayed in the dialog and the default button |
The msgBox method is always executed on the client node or presentation client workstation, even if it is called from a server method.
While a message box is displayed, notifications and timer events continue to be processed.
An exception is raised (that is, 1291 - GUI request not allowed in this context) if this method is called in a non-GUI application.
It is not good programming practice to display message boxes while in transaction state (that is, you should abort or commit the transaction before calling the msgBox method).
In JADE thin client mode, this method executes on the presentation client workstation. The following example shows the use of the msgBox method in which the OK and Cancel buttons are displayed.
vars number : Integer; begin number := app.msgBox("Delete this object?", "Deletion Confirmation", MsgBox_OK_Cancel); if number = MsgBox_Return_Cancel then // canceled? return; endif; ... end;