Creating and Passing .NET Objects as Parameters

ACUCOBOL-GT programs can retrieve .NET objects or pass .NET objects as parameters. These .NET objects can also be acted upon using the MODIFY and INQUIRE statements.

.NET objects are supported by identifying them as belonging to the generic namespace of "MICROFOCUS" and class "NETOBJECT". A COBOL program that wants access to .NET objects must have defined @MICROFOCUS.NETOBJECT in the Special-Names paragraph.

.NET objects must be stored in a data type identified by "USAGE HANDLE OF OBJECT". If you wish to invoke MODIFY and INQUIRE statements for certain GET/PUT properties or methods on the .NET object, you need to create the equivalent COBOL definitions as part of the @MICROFOCUS.NETOBJECT namespace/class. You can create the .def file for this generic object with NetDefGen.

Limits and Restrictions

  • .NET objects cannot be created in your COBOL program. They are only retrieved or passed as a parameter.
  • Overloaded methods are not supported with .NET objects. Only one definition may be used.
  • .NET objects cannot be retrieved or passed if they are part of an array/list.
  • .NET objects cannot be retrieved from events using the C$GETNETEVENTDATA library routine.
  • .NET objects as parameters are not supported when using the runtime switch - -a2n