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
  • Mozdzierz,

    Open a Visual COBOL command prompt.

    Create your text file containing

    set printer_redirection=true

    From the command line

    set COBCONFIG=<path>\cobconfig.cfg

    Run your app. If your USB printer is your default printer and your COBOL code is using ASSIGN TO PRINTER in the file descriptor it should now write to the USB printer.

    To do the same from the Visual Studio IDE, open the Properties for your application, go to the Application page, click on the Environment button and set COBCONFIG to the value <path>\cobconfig.cfg. Then when you run your application from within Visual Studio it should pick up the configuration.

    I hope that helps,

    Gael

Reply
  • Mozdzierz,

    Open a Visual COBOL command prompt.

    Create your text file containing

    set printer_redirection=true

    From the command line

    set COBCONFIG=<path>\cobconfig.cfg

    Run your app. If your USB printer is your default printer and your COBOL code is using ASSIGN TO PRINTER in the file descriptor it should now write to the USB printer.

    To do the same from the Visual Studio IDE, open the Properties for your application, go to the Application page, click on the Environment button and set COBCONFIG to the value <path>\cobconfig.cfg. Then when you run your application from within Visual Studio it should pick up the configuration.

    I hope that helps,

    Gael

Children
No Data