RunUnitAdd Method

MicroFocus.COBOL.RuntimeServices
Adds a new instance of a Procedural COBOL program or Object COBOL Class to the session.

This method is only required if you need to instantiate the class outside of the session

Namespace:  MicroFocus.COBOL.RuntimeServices
Assembly:  MicroFocus.COBOL.RuntimeServices (in MicroFocus.COBOL.RuntimeServices.dll) Version: 1.2.3.4
Syntax

public void Add(
	Object program
)

Parameters

program
Type: SystemObject
ProgramName

Implements

IRunUnitAdd(Object)
Exceptions

ExceptionCondition
ArgumentExceptionIf program is either null or not a COBOL program or StopRun has been invoked.
Examples

var myRunUnit = new RunUnit();
try
{
  var myProgram1 = new Program1();
  myRunUnit.Add(myProgram1);
  myProgram1.Program1("Johnson", 32);
}
finally
{
  // Destroy the run unit
  myRunUnit.StopRun();
}
See Also

Reference