RunUnitCallObject Method

MicroFocus.COBOL.RuntimeServices
Executes a program in the new run-unit with a set of parameters
The parameters are currently restricted to objects or native IL types

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

public Object CallObject(
	string program,
	params Object[] parameters
)

Parameters

program
Type: SystemString
parameters
Type: SystemObject

Return Value

Type: Object

Implements

IRunUnitCallObject(String, Object)
Exceptions

ExceptionCondition
ArgumentExceptionIf StopRun method has already been invoked.
Examples

// Create a run unit for the called COBOL program
var myRunUnit = new MicroFocus.COBOL.RuntimeServices.RunUnit();
try
{
 // Call the COBOL method and implicitly instantiate it
  var resultString = myRunUnit.CallObject("ProgString");
  Console.WriteLine(resultString);
}
finally
{
  // Destroy the run unit
  myRunUnit.StopRun();
 }
cobol
program-id. ProgString.
working-storage section.
linkage section.
01 ret-string       string.
procedure division returning ret-string.
    set ret-string to "Hello from ProgString".
    goback.
end program ProgString.
See Also

Reference