Previous Topic Next topic Print topic


Managed COBOL

Documentation
A guide that provides a basic introduction to Object-Oriented Programming (OOP) for COBOL developers, An Introduction to Object-Oriented Programming for COBOL Developers, with examples is now available from the Product Documentation section on the Micro Focus SupportLine Web site - click here to download it.
Named and optional parameters
Two new types of parameter have been introduced for use during method invocation:
Named parameters
As part of the invocation expression, you can define a value for a parameter named in the method definition. The named argument must be specified after any positional arguments, and must not correspond to any of those preceding arguments.
Optional parameters
Optional parameters are parameters defined with a default value in the procedure division header of the invoked method. If none of the arguments passed in during invocation correspond to this parameter, the default value is used in the method; if an argument does correspond, the value that was passed in is used.
Delegates and events

A number of new features have been added that relate to delegates and events:

Note: Some of these features were also available in previous versions of Visual COBOL.
The ATTACH and DETACH statements
Use these statements to attach or detach a delegate, method group or an anonymous method to or from an event.
The RUN statement
Use this statement to invoke a delegate once it has been created.
Combining delegates
Use the '+' operator to add a method group, anonymous method or another delegate to a delegate, and use the '-' operator to remove a method or another delegate from a delegate.
Method groups conversions
Use the METHOD keyword to specify a compatible method from a method group, and convert it to a delegate.
Previous Topic Next topic Print topic