Yes, i want to output a pic X on com1:, i'm writing a cash-register program and to open my cash-drawer, it request a signal on com1:, i've tried to a text file to com1 in dos-mode and that works fine, so my question is, can i do this in MF cobol.
I've written software that writes to a receipt printer and has a cash drawer attached. I'm printing to the printer using the 'PC_PRINTER_WRITE' statements. The printer will open the cash drawer if you set it to a certain font (the control font) and then send it a command - see below:
move length of cdfontname to cdfontnamesize.
move 10 to cdfontpointsize.
move 0 to cdfontstyle.
call 'PC_PRINTER_SET_FONT'
using by reference printerhandle
by reference cdfontfamilyname
by value cdfontpointsize
by value cdfontstyle
returning statuscode.
call 'PC_PRINTER_WRITE'
using by reference PrinterHandle
by reference "A" *> code to open the drawer
by value 1 size 4
returning StatusCode.
call 'PC_PRINTER_CONTROL'
using by reference PrinterHandle
by value 3 size 4 *> flush the print buffers
returning StatusCode.
Yes, that is a solution for the cash drawer, but can I call DOS commands from cobol, else is my cash drawer working, but can i not write to the receipt printer.
I think i have the solution myself,
printing to com1: is the same as printing
to a file, so i declare a file with the name
comport and i set the name of the file like this "com1:"
I think this wil work, but i can't test one the moment.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.