If you have already printed something to file, why not just open it with a text editor and print it ??
If you are asking to take an output file which was written to disk and use it as input, that is most likely impossible depending on how the output is. Chris Green
Computer Information Systems Student
Cayuga Community College -- Fulton
i have a microfocus compiler and with this there is a command which calls a print command to print the contents of a file.
if the file is already in print format then the ascii codes should already be in there for page breaks, line spacing etc.. therefore printing it out from the compiler or any text editor should do
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!!!
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.