- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use the following method to send output directly to the printer:
OPEN(8,FILE='LPT1',CARRIAGE CONTROL='FORTRAN',IOSTAT=IS)
WRITE(8,'(1X,''BLAH'')')
where there are probably 100's of WRITE statements after the OPEN statement.
Occasionally, the printer will skip a character. This is obvious because much of my output is in columns and there's a "jog" in one line every once in a while. I use NT and I haven't noticed the problem myself, but some of the other people in our company run the same Fortran program on Windows 95 and this is where the problem seems to crop up.
I know I could use unit 6 which is preconnected to the printer, but I should explain the little code snippet above has been simplified. Actually, FILE points to a variable which can be a disk file, a network printer, 'CON' or 'LPT1'.
The problem does not occur on just one particular printer, so I don't think it's a printer problem.
Does anybody have any idea what the problem could be? Is there a better way to send output to a printer?
Thanks,
Randy
OPEN(8,FILE='LPT1',CARRIAGE CONTROL='FORTRAN',IOSTAT=IS)
WRITE(8,'(1X,''BLAH'')')
where there are probably 100's of WRITE statements after the OPEN statement.
Occasionally, the printer will skip a character. This is obvious because much of my output is in columns and there's a "jog" in one line every once in a while. I use NT and I haven't noticed the problem myself, but some of the other people in our company run the same Fortran program on Windows 95 and this is where the problem seems to crop up.
I know I could use unit 6 which is preconnected to the printer, but I should explain the little code snippet above has been simplified. Actually, FILE points to a variable which can be a disk file, a network printer, 'CON' or 'LPT1'.
The problem does not occur on just one particular printer, so I don't think it's a printer problem.
Does anybody have any idea what the problem could be? Is there a better way to send output to a printer?
Thanks,
Randy
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See this Fortran_WinPrint example code. This works MUCH better than writing directly to LPT1. Just add the module source to your project and call Print_Unit after you've written the file to disk.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Randy, I think your problem depends on CARRIAGECONTROL='FORTRAN', which skips the first character. Take away that or replace it with CARRIAGECONTROL='LIST' (or ='NONE', depending on your file format). For more information see OPEN Statement in the on-line help.
Regards,
Sabalan.
Regards,
Sabalan.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page