Description: | Opens (Shows) a form in "Modal" mode. "Modal" means that the parent form is inactive until the child form is closed. The child form looks like a dialog box. It is different from the OpenForm method in that control is returned after all the child form's procedures have completed. The child form cannot be re-opened if the child form is already open. |
Used in controls: | None. |
Used in objects: | Form |
Parameters: | VT_BSTR - FormNameX(8192) [VT_BSTR - DllNameX(8192)] [VT_I4 - CookieS9(9) COMP-5] |
Description of Parameters: | FormName: The name of the form to be opened. DllName: When the form is in a DLL file, defines the name of the DLL file containing the form. Cookie: An integer to distinguish the opened form. |
Return value: | VT_I4 - ReturnValueS9(9) COMP-5 This is the value set in the Result parameter when the CloseForm method is invoked. |
DLL Search Path: | When the DllName parameter does not contain the full path, PowerCOBOL searches for the DLL folders in the following order: 1. The folder containing the execution file. |
Example: | To invoke another form called "DialogBox1", contained within the same module, you would code: WORKING-STORAGE SECTION. 01 ReturnValue PIC S9(9) COMP-5. PROCEDURE DIVISION. INVOKE POW-SELF "CallForm" USING "DialogBox1" RETURNING ReturnValue IF ReturnValue = ID-OK * Code to handle a good return : END-IF Where ID-OK is a global variable set in a top-level section of each form, such as the forms' CONSTANT sections: 01 ID-OK PIC S9(9) COMP-5 VALUE 1 IS GLOBAL. To return from "DialogBox1", with an "OK" value you would code, in a closing event such as the user clicking on DialogBox1's "OK" button: INVOKE POW-SELF "CloseForm" USING ID-OK |
Backward compatibility | None. |