Top
NetCOBOL V11.0 Getting Started with COM Components
FUJITSU Software

1.5 Properties

Properties are data items that are defined in the class’ WORKING-STORAGE SECTION. Properties may be either Public or Private. In the sample OO COBOL program shown in Figure 1.2, the following definitions are property definitions.

 01 Infile-Status Pic 99.
 01 File-Opened-Flag Pic 9 Value 0.

These properties may be referenced by any method within the class and may thus be thought of as global data items within the class. By default, WORKING-STORAGE SECTION data items defined at the class level are Private properties. Private properties are not exposed to the outside world and thus cannot be referenced from outside programs. To create a Public property that would be exposed to outside programs, we would simply add the “Property” key word in the definition such as.

 01 Infile-Status Pic 99 Property.
 01 File-Opened-Flag Pic 9 Value 0 Property.