This one.....i got this from the online reference with my microfocus compiler. Presumably all compilers will have similar routines???
If you write your print commands to a disk file instead of to the printer using the normal AFTER PAGE/LINE clauses etc then use the routines below, it prints out as normal......
Introduction to Windows Printer Handling Routines
To use the Windows printer handling routines with .int and .gnt code files created using the 16-bit COBOL system, you must load the file mfprnt16.dll before calling any of the routines. You can do this by using the following code in your program:
working-storage section.
01 mfprn-ptr procedure-pointer.
procedure division.
set mfprn-ptr to entry "mfprnt16".
then.....
PC_WIN_PRINT_FILE
Sends the specified file to the printer.
call "PC_WIN_PRINT_FILE" using filename
returning status-code
Parameters:
filename pic x(<n>).
status-code See Key
On Entry:
filename The name of the file to be printed. The name must be space- or null-terminated.
On Exit:
status-code Printer status code:
0 Successful
1 Could not open printer device
3 Printer device not open
4 Out of memory while printing
5 Failed to open file
6 Disk full while spooling file
7 Print job aborted. No file spooled to Print Manager
9 No default printer found. Select a printer from Windows Control Panel.
11 Write failure
Comments:
This routine is available only in the Windows environment.
Example:
To print out the file c:utoexec.bat:
call "PC_WIN_PRINT_FILE"
using by reference "c:utoexec.bat" &x"00"
jimlee jimlee, who is just to take exams, wish me luck!!!