Unlike individual control procedures (scriptlets), which typically contain only local data and execution statements, form procedures also include declaration statements for the entire form and for any common procedures within the project. The kinds of statements that can be included are:
SPECIAL-NAMES
REPOSITORY
FILE-CONTROL
BASED-STORAGE
FILE
WORKING-STORAGE
CONSTANT
PROCEDURE
To access form procedures, right-click the mouse on any blank area of a form. The following pop-up menu will appear:
From this pop-up menu, you can display individual form divisions, sections, and event procedures by selecting the appropriate option.
If you move the mouse over Edit ENVIRONMENT DIVISION, a secondary pop-up menu will appear from which you can select SPECIAL-NAMES, REPOSITORY or FILE-CONTROL.
Describes optional Class definitions such as the special *OLE class.
Describes the FILE-CONTROL statement of the INPUT-OUTPUT section in the ENVIRONMENT DIVISION of a COBOL program.
Use the SELECT statement in the FILE-CONTROL event procedure to declare which files the form will use. This function is required only if a file is called from within a form. The following figure shows how the FILE-CONTROL is declared.
If you move the mouse over Edit DATA DIVISION, you can select the BASED-STORAGE, FILE, WORKING-STORAGE, or CONSTANT sections.
Describes the FILE section in the DATA DIVISION of a COBOL program.
Specify the File Descriptor of data files (FD's) and their associated record definitions, in the FILE section. The following figure shows how the FILE section is declared.
The IS GLOBAL clause in the FD statement allows the file to be accessed from any event procedure (scriptlet) within the form.
Describes the CONSTANT section in the DATA DIVISION of a COBOL program.
The following figure illustrates using the CONSTANT statement to declare the names and values that do not change throughout the execution of a program.
The use of the IS GLOBAL clause allows the constants to be referenced within any of the form's event procedures.
If you move the mouse over Edit PROCEDURE DIVISION, you may select the New or PROCEDURE options.
Allows you to create common internal procedures within a form. These are procedures that are not ties to any specific event, but may be called from other procedures in the application. For example, if you needed to write a procedure to read in some records from a data file and populate a control on the form, you might want to place this code in a separate callable procedure.
Any procedures that are called within a program, or called from within other procedures, can be described in the PROCEDURE window.
PowerCOBOL will assign a default name to each procedure you create here. You may change the name in the left windowpane of the Project Manager window by selecting it and typing in a new name.