Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

9.3 Sharing Data between PowerCOBOL Forms and Procedures

Within a PowerCOBOL procedure, you can typically only refer to data that is defined within that procedure.

If you wish to share data between individual procedures within a PowerCOBOL form, you mush place the data declaration in the form's WORKING-STORAGE section, and specify the IS GLOBAL clause.

You do this by right clicking on the form name in the PowerCOBOL Project Manager and selecting Edit DATA DIVISION from the pop-up menu, then select WORKING-STORAGE from the secondary pop-up menu.

You may then insert a data declaration such as follows:

Figure 9.3 A Global data declaration in the form's WORKING-STORAGE section

If you wish to share data between separate forms and/or .DLL modules, simply add the EXTERNAL clause to the data declaration as follows:

Figure 9.4 A Global External data declaration in the form's WORKING-STORAGE section

Note that anywhere you wish to reference a global or external data item, the current module must contain the identical definition in its Working-Storage Section.

And, global or external data can be used only when the Script Language property of a module is "0-COBOL85 Language Mode". If you wish to share data when the Script Language property is "0-OOCOBOL Language Mode", create an ActiveX control and use the custom properties and custom methods to refer/set the data.