You can set run-time environment variables and switches to configure the run-time environment for when your applications start running.
Restriction: The following applies to native code only.
To set environment variables for when you run the project from within the IDE:
- In Visual Studio, navigate to the
Application page in the project properties - click
Project >
MyProject Properties, and then click
Application.
- Click
Environment.
- 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:
- 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.
- On the
Environment tab, type a variable name and its value in the
Name and
Value fields, and click
Set.
- On the
COBOL Switches tab, check the switches you require.
- 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.
- 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.