An ActiveX control may have property, method, or event names that are the same as COBOL reserved words or ACUCOBOL-GT standard property or style names. This situation creates ambiguity for the compiler. In addition, because ActiveX class names are used in the USAGE HANDLE clause of data description entries, in Screen Section items, and in DISPLAY statements, they may also cause ambiguities with COBOL reserved words.
To avoid these ambiguities, AXDEFGEN prepends an "at" sign character ("@") to every class, property, method, and event name in the generated COPY file.
In addition, ambiguity may occur with event names when two or more ActiveX controls define the same event name. To reduce this possibility, AXDEFGEN prepends the control name to each event name. For example, if an ActiveX control named "MyControl" has an event called "RightMouseButtonClick", AXDEFGEN names the control "@MyControl" and the event "@MyControlRightMouseButtonClick".
The "@" sign is not required unless ambiguities exist in the meaning in a certain context. However, to guard against unanticipated name conflicts and to ensure clarity in the reading and maintenance of the source code, we strongly recommend that you always use "@" when referring to an ActiveX property, style, or method in your source code.
If you do not use an "@" sign and a clash occurs, a compiler error results. For example, if you had a component named Editor that has a method Open, the following would cause a compiler error because Open clashes with ACUCOBOL-GT syntax:
... 77 hDocument HANDLE OF Editor. ... PROCEDURE DIVISION. MAIN. DISPLAY Editor LINE 1, COLUMN 1, LINES 10, SIZE 80, HANDLE IN hDocument. MODIFY hDocument Open("myfile.txt"). ...
To address this, prepend the method name with an "@" as shown below:
... 77 hDocument HANDLE OF Editor. ... PROCEDURE DIVISION. MAIN. DISPLAY Editor LINE 1, COLUMN 1, LINES 10, SIZE 80, HANDLE IN hDocument. MODIFY hDocument @Open("myfile.txt"). ...
If a class name immediately follows the level number in a Screen Section item, you must either use the "@" prefix or specify FILLER between the level number and class name.