Gets a specific program from the rununit with a option to create it.
Namespace: MicroFocus.COBOL.RuntimeServices.Generic
Assembly: MicroFocus.COBOL.RuntimeServices (in MicroFocus.COBOL.RuntimeServices.dll) Version: 1.2.3.4
Syntax
public AnotherProgramOrClass Get<AnotherProgramOrClass>( bool create = false ) where AnotherProgramOrClass : IObjectControl
Parameters
- create (Optional)
- Type: SystemBoolean
Type Parameters
- AnotherProgramOrClass
Return Value
Type: AnotherProgramOrClassExamples
using(var myRunUnit = new RunUnit<myapp>()) /* Create a RunUnit and include myapp in it */ { using(myRunUnit.Enter()) { /* Enter myRunUnit */ myapp app = myRunUnit.Get(); /* use the methods */ app.SomeMethod(); app.AnotherMethod(); otherprogram op = myRunUnit.Get<otherprogram>(true); op.otherprogram(); } // Leave myRunUnit } // StopRun
See Also