ACUCOBOL-GT uses a special type of COBOL identifier that is context-sensitive. These are the style and special property names of controls. Each type of control has a set of styles and special properties that apply to it. If these names were reserved words in COBOL, there would be many new reserved words, making it likely that existing programs would have to be changed to be compiled with ACUCOBOL-GT. Because more styles and special properties are expected in future versions, this proliferation of reserved words would create an ever-increasing problem.
To address this issue, ACUCOBOL-GT does not reserve the style and special property names in the usual manner. Instead, the Compiler reserves them only when in the context of acting on a control of the proper type. For example, when you are defining an entry-field control in the Screen Section, the style and special property names associated with entry fields are reserved. At other times, they are not. This allows you to declare variables and paragraphs with the same names as long as you do not try to refer to those items in a context where the reserved meaning would apply.
Style and special property names are reserved in the following four cases:
At all other times, the style and special property names are not reserved.
Since the Compiler reserves only names that are appropriate for a particular type of control, it can recognize those names only when it knows what type of control is being acted on. If the control class is generic (variable), the Compiler cannot determine which set of names to reserve, so it does not reserve any of them. This leads to cases where the Compiler cannot resolve seemingly correct code.
For example, MAX-TEXT is a special property name associated with entry fields. The following code appears to be correct, but will not compile:
77 FIELD-1 USAGE HANDLE. MODIFY FIELD-1, MAX-TEXT = 15.
In the above example, the Compiler does not recognize MAX-TEXT as a meaningful word because it does not know that FIELD-1 is an entry field. For this code to compile, you would have to change it to read:
77 FIELD-1 USAGE HANDLE OF ENTRY-FIELD. MODIFY FIELD-1, MAX-TEXT = 15.
By declaring FIELD-1 as a handle to an entry field, you alert the Compiler to use the style and special property names associated with entry fields whenever it is referenced.
For example, the level 78 name that corresponds to MAX-TEXT is EFP-MAX-TEXT ("EFP" is short for Entry Field Property). The following code is another way of coding the preceding example:
77 FIELD-1 USAGE HANDLE. MODIFY FIELD-1, PROPERTY EFP-MAX-TEXT = 15.
In most cases, you will probably use the style and special property names known by the compiler. However, the advantage of using the values provided in controls.def is that you can assign them to variables that need to be set dynamically (at run time).