Skip to main content

We have a batch system which is being converted from NetExpress to MF Visual COBOL 8.

In VS when debugging we are using Environment Variables to define file and report paths. But when the EXE is used in Testing or released to client we don't want the Environment Variable included as the report/file paths will be in the BAT file.  

If we don't tick the 'Use variables when building the project' when debugging will the variables be used but when compiling/build for release will the variables be ignored? 

In NetExpress we had two projects, a development project where the environment variables would be populated and then a release project which the environment variables would not be entered. I am trying to get away from having to have separate projects, one for development and one for release.

We have a batch system which is being converted from NetExpress to MF Visual COBOL 8.

In VS when debugging we are using Environment Variables to define file and report paths. But when the EXE is used in Testing or released to client we don't want the Environment Variable included as the report/file paths will be in the BAT file.  

If we don't tick the 'Use variables when building the project' when debugging will the variables be used but when compiling/build for release will the variables be ignored? 

In NetExpress we had two projects, a development project where the environment variables would be populated and then a release project which the environment variables would not be entered. I am trying to get away from having to have separate projects, one for development and one for release.

Hello,

Those environment variables are for use with the project or in the IDE. When set they will be added to your debugging/runtime environment WHILE using the project. This allows you to resolve external files or things based on environment variables without having to set them in the OS environment or in a .BAT file.  They are not compiled into the generated module. When you run the .EXE outside of the IDE (Release version) you will need to set those environment variables which is what you are doing in the .BAT file.  I believe this is the behavior you are looking for. Only one project is needed with most likely a Debug and Release configuration.


Hello,

Those environment variables are for use with the project or in the IDE. When set they will be added to your debugging/runtime environment WHILE using the project. This allows you to resolve external files or things based on environment variables without having to set them in the OS environment or in a .BAT file.  They are not compiled into the generated module. When you run the .EXE outside of the IDE (Release version) you will need to set those environment variables which is what you are doing in the .BAT file.  I believe this is the behavior you are looking for. Only one project is needed with most likely a Debug and Release configuration.

Excellent, thanks a lot of your help