Top
PowerCOBOL V11.0 Reference
FUJITSU Software

5.23 CloseForm Method

Description:

Closes the form and child forms opened from the form.

Used in controls:

None.

Used in objects:

Form

Parameters:

[VT_BSTR - FormNameX(8192)]

[VT_BSTR - DllNameX(8192)]

[VT_I4 - Result S9(9) COMP-5]

Description of Parameters:

FormName: The name of the form to be closed.
When it is omitted with the DllName parameter, the form itself is closed (its effect is equal to the Deactivate method).

DllName: The name of the DLL file containing the form.
If it is omitted PowerCOBOL searches for the form name in the application.

Result: This value is set to the ResultValue parameter passed to the CallForm2 (CallForm) method. (This parameter is not effective for a form opened with the OpenForm method).

Note that the order of parameters is different from the order of CLOSESHEET's parameters.

Return value:

VT_I4 - ReturnValueS9(9) COMP-5

Zero indicates normal completion.
Non-zero indicates an error.

Note:

If event procedures in the form to be closed have not finished, the CloseForm method waits for them to complete.

Example:

1. To close a form itself code:

INVOKE POW-SELF "CloseForm" 
  USING Result-Code

Where Result-Code contains a value you wish to communicate to the invoking form.

2. To close a form called "Subform1" from another form, contained in the same DLL module, code:

INVOKE POW-SELF "CloseForm"
  USING "Subform1"

Backward compatibility
method name:

CLOSESHEET

Backward compatibility
arguments:

1. X(260) - DLL
2. X(14) - Sheet (form) name