×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

lahey fortran 95/90 accessing printer

lahey fortran 95/90 accessing printer

lahey fortran 95/90 accessing printer

(OP)
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

RE: lahey fortran 95/90 accessing printer

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  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources