Can PRINTER REDIRECTION=TRUE be set from program?
This has been discussed here in 2014: https://community.microfocus.com/microfocus/cobol/visual_cobol/f/forum/13102/setting-environment-variables-prior-to-build
Is there a better way now? We have PRINTER REDIRECTION=TRUE in a config text file pointed to by MF's cobcofig_ environment variable which we have to set on all client machines. Is there a better way, direct from the code? I'm looking for a global solution without changing our old print programs. MY ENVIRONMENT: Visual Studio 2015; Latest Visual COBOL V3; Windows clients running our application .exe with COBOL SERVER V3.
I tried ticking, 'use variables when building the project' under, Project properties---Application---[environment...] but no joy. Maybe that just refers to the build process itself?
Linden Rowland - IT Consultant
IT Consultant to Tindle Newspaper Group
RE: Can PRINTER REDIRECTION=TRUE be set from program?
Right-click on your project and select Add--New Item and select Application Configuration File. Then double-click on the application.config file in solution explorer and select the run-time configuration tab. Set the option for Redirect ASSIGN TO PRINTER to the Windows print spooler to true. When you rebuild the project a file with the same name as your executable with an extension of .mfgcf will be placed into the output folder. Include this with your executable and you shouldn't have to set an environment variable anymore.