INVOKE Statement

Invokes a method.

invoke-statement

method-invocation-expression

Example

In the following example, the arguments a and b above are passed to the invoked method, and these correspond to the parameters x and y respectively, in the invoked method. The types of the parameters are specified in the AS phrase in the method signature.

       01 a string.
       01 b binary-long.
       invoke type MyClass::MyMethod(a,b)
       ...

       method-id MyMethod (x as string, y as binary-long).
       ...
       end method.

See also the Core sample, which is available from Start > All Programs > Micro Focus Visual COBOL > Samples, under COBOL for .NET .