Previous Topic Next topic Print topic


Compiler

Calling methods
The COBOL Compiler no longer supports calling a method with "self" as a parameter, when the method parameter definition is "by reference" (explicit or implicit). Instead, the method parameter definition should be "by value". This brings the COBOL compiler in line with C#.

Note that you might need to update your code so that it defines the method parameters “by value”.

For example, the following construct is no longer correct and generates error COBCH0829:

       method-id myMethod using x as myClassName. 
       …
       invoke myMethod(self).

The correct way to define the method parameters is “by value”:

       method-id myMethod using by value x as myClassName.
Previous Topic Next topic Print topic