Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: File Handler behavior in managed code

$
0
0

Actually a better place to set the environment variables would be within the instantiated RunUnit itself so that this would not be set globally.

There is a SetEnvironmentVariable method in the RunUnit class:

Example:

 MicroFocus.COBOL.RuntimeServices.RunUnit myRunUnit =
              new MicroFocus.COBOL.RuntimeServices.RunUnit();
            try
            {
                // Call the COBOL program
                COBPROG cp = new COBPROG();
                myRunUnit.Add(cp);
                myRunUnit.SetEnvironmentVariable("dd_NEW", "C:\\temp");
                
                myRunUnit.Call("COBPROG", "11111111111111111111");
            }
            finally
            {
                // Destroy the run unit
                myRunUnit.StopRun();
            }

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>