Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lahey fortran 95/90 accessing printer 1

Status
Not open for further replies.

kknowle2

Civil/Environmental
Jan 16, 2001
19
0
0
US
I have just purchased lahey fortran v5.6. does anyone know how to access the printer. With MSfortran v5.0 you could just use OPEN(UNIT=7,FILE='PRN')
and WRITE(7,*)'TEST'
etc.
but Lahey 95 and 90 won't access the printer. I've been told that I need to access the printer through Windows. How do I do this. A program written in MSfortran v5.0 has no problem accessing and writing to my printer on LPT1. I'm using windows98.
Would appreciate some help.
Thanks,
Kevin
 
Replies continue below

Recommended for you

Opening the printer like that is not standard fortran, so the method will vary with compilers. I use Lahey 5.6 also, however, I'm not sure if you can do what you want to do ( I haven't tried myself ). I don't recommend that you do it anyhow. Most people have inkjet or laser printers nowadays, and your way of accessing things is not going to work on a lot of systems regardless of the fortran compiler you use.

Accessing the printer through Windows: Generally, people have a printer hooked to thier systems which Windows recognizes. By default, all print request go through Windows and Windows finds the printer ( with drivers already loaded ) and does its thing. Personally, I recommend you don't circumvent this, simply because it will give you the most portability across computer systems people are likely to have.

Possible solution to your problem:
I think Lahey can work similar to MS Powerstation here. You'll have to contact Lahey technical support to find out though. It might work differently on various versions of Windows, etc.

You can also do this:
OPEN(UNIT=7,FILE='tempfile')
WRITE(7,*) ' use as many writes to the file as you like.'
Close ( 7 )

From Windows, manual print out the file you have just created. Otherwise, Lahey has some porting extensions listed at the back of the Language reference guide. One of them may allow you to print directly from within your program. Also... Wisk ( a Winteracter subset is included with your Lahey compiler )... "might" have the capability to send a file directly to the printer. I know the full Winteracter product will allow this.

Dan :)
 
Status
Not open for further replies.
Back
Top