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:
- In Visual Studio, navigate to the
Application page in the project properties - click
Project >
MyProject Properties, and then click
Application.
- Click
Environment.
- Click
Add in the
IDE Settings dialog box.
- Type the name and the value of the environment variable you would like to set, and then press
Enter.
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
.mfgcf extension. If the file does not exist, add one for the project - see
Related information.
- On the
Environment tab, click
Add, type a variable name and its value in the
Name and
Value fields, and press
Enter.
- 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.