Getting cobconfig to work.

I saw a post on how to get MF Visual Cobol to print to a USB printer, instead of the default LPT1. However, it was not as descriptive as I would have hoped. Since I have not worked with Cobol since 1995 and went into the business world using Fortran after that class, I never found the need to set environment variables. I also never used MF Cobol before now. The one post states to create a file called cobconfig.cfg and then set the cobconfig environment variable to point to that file. Well, I have tried a couple of ways on my own and could not get it to set the environment variable of cobconfig and work. Any help that someone can provide in getting the cobconfig environment variable to work in MF Visual Cobol for Visual Studio 2012 would be greatly appreciated. I've looked far and wide on the net and have not yet found any specific help. I did get the old program to work via sending the output to a file, but I want to get it to work as originally intended to a printer and not to the old LPT1 port. A specific example of how to set the variable would be great.

Parents
  • Verified Answer

    Apologies mozdzierz, I assumed that you were working with a native code project since you referred to setting cobconfig but the exception indicates that you are running a managed code program which does not use that file at all.

    In a managed code project you need to add an Application Configuration File to the project (via Add -> New Item on the context menu in Solution Explorer) and add an entry for the printer_redirection tuneable to that. What you need to add is shown in the following topic in the product documentation

    Format of a Configuration File for .NET COBOL

    and it actually contains both printer_redirection and printer_defaults

    Gael

Reply
  • Verified Answer

    Apologies mozdzierz, I assumed that you were working with a native code project since you referred to setting cobconfig but the exception indicates that you are running a managed code program which does not use that file at all.

    In a managed code project you need to add an Application Configuration File to the project (via Add -> New Item on the context menu in Solution Explorer) and add an entry for the printer_redirection tuneable to that. What you need to add is shown in the following topic in the product documentation

    Format of a Configuration File for .NET COBOL

    and it actually contains both printer_redirection and printer_defaults

    Gael

Children
No Data