Description: | Displays a message box. The user needs to respond to the message box (needs to select a button) to continue the process. |
Used in controls: | None. |
Used in objects: | Form |
Parameters: | VT_BSTR - TextStringX(8192) VT_BSTR - MessageTitleX(8192)] [VT_I4 - MessageStyleS9(9) COMP-5] |
Description of Parameters | TextString: The text to be displayed in the message box. You can start new lines in the message by inserting the value X"0A" in the TextString data item. MessageTitle: The text to be displayed in the message box title. If this parameter is omitted PowerCOBOL uses the form Caption property in the title. MessageStyle: The style of the message box. |
Type Group | The buttons to display. POW-DMOK (The default): A single OK button. POW-DMOKCANCEL: OK and Cancel buttons. POW-DMABORTRETRYIGNORE:Abort (Stop), Retry and Ignore buttons. POW-DMYESNOCANCEL:Yes, No and Cancel buttons. POW-DMYESNO:Yes and No buttons. POW-DMRETRYCANCEL:Retry and Cancel buttons. |
Icon Group | The icon to display. POW-DMNOICON (The default):No icon. POW-DMICONSTOP:Displays the stop icon. POW-DMICONERROR:Displays the error icon. POW-DMICONQUESTION:Displays the question mark icon. POW-DMICONEXCLAMATION:Displays the exclamation mark icon. POW-DMICONWARNING:Displays the warning icon. POW-DMICONINFORMATION:Displays the information icon. Note that currently: |
Default Button Group | The button used when the ENTER key is pressed. POW-DMDEFBUTTON1: (The default) The first button is the default. POW-DMDEFBUTTON2: The second button is the default. POW-DMDEFBUTTON3: The third button is the default. |
Return value: | VT_I4 - ReturnValue S9(9) COMP-5 The result of displaying the message box. Use the following constants to check the return value. POW-DMRNOMEMORY: The message box could not be displayed because of insufficient memory. POW-DMROK:The OK button was pushed. POW-DMRCANCEL:The Cancel button was pushed. POW-DMRABORT:The Abort (Stop) button was pushed. POW-DMRRETRY:The Retry button was pushed. POW-DMRIGNORE:The Ignore button was pushed. POW-DMRYES:The Yes button was pushed. POW-DMRNO:The No button was pushed. |
Example: | 01 Message-Style PIC S9(9) COMP-5. 01 ReturnValue PIC S9(9) COMP-5. PROCEDURE DIVISION. MOVE 0 TO Message-Style * Select a message box with OK and * Cancel Buttons ADD POW-DMOKCANCEL TO Message-Style * Display the Information Icon * in the message box ADD POW-DMICONINFORMATION TO Message-Style * Make sure the first button (OK) * is the default button for * hitting the enter key. ADD POW-DMDEFBUTTON1 TO Message-Style INVOKE POW-SELF "DisplayMessage" USING "Display this Message!" "The Title I Want" Message-Style RETURNING ReturnValue |
Backward compatibility | DISPLAYMESSAGE |
Backward compatibility | 1. X(256) |