To configure the run-time behavior for native applications

You can set run-time environment variables and switches to configure the run-time environment for when your applications start running.
Restriction: The following only applies to native code.

To set environment variables for when you run the project from within the IDE:

  1. In Visual Studio, navigate to the Application page in the project properties - click Project > MyProject Properties, and then click Application.
  2. Click Environment.
  3. Type the name and the value of the environment variable you would like to set, click Set, and then click OK.

To set environment variables and switches in the application configuration file:

  1. In Solution Explorer, right-click the application configuration file in the project, and click Open.

    By default, an application configuration file has a .config extension. If the file does not exist, add one for the project - see Related information.

  2. On the Environment tab, type a variable name and its value in the Name and Value fields, and click Set.
  3. On the COBOL Switches tab, check the switches you require.
  4. On the Run-time Configuration tab, configure settings such as the search order for called programs, command line handling and file handling options, and input/output settings.
  5. Click OK.
Note: If you run your application outside of the IDE, you need to set the environment variable COBCONFIG.BLOCK to the location of the application configuration file in order for the switches and environment variables set for the application to be applied.