Topic: How to print to my Brother printer in Fortran 77

How to define unit 6 as my printer?

Re: How to print to my Brother printer in Fortran 77

I found out that a WRITE statement with unitnumber 6 effectively does write to the printer.
After the job is finished you have to go to the file tab and choose the print option.In The new pane you choose your printer and print the job. (verything that has been send to the printer.
s there an other way?

Re: How to print to my Brother printer in Fortran 77

There isn't a "portable" way to print from a conventional Fortran program to a printer directly.  Such actions did make sense to some degree when line printers were still normal, but modern printers effectively require an image of the page to be sent to the printer. 

Fortran is a general-purpose language, so one could conceivably use the Windows API to write routines which would send something directly to the printer, but it wouldn't be as simple as assigning a unit number it would be hundreds to thousands of lines of code.  Similar work would be necessary on macOS and Linux.

The simplest way to achieve what you want is to write to a file (preferably using a unit number other than 6), open the file directly in Simply Fortran or another text editor, and printing that file from there.

Jeff Armstrong
Approximatrix, LLC

Re: How to print to my Brother printer in Fortran 77

Thanks Jeff.
This makes it clear to me.
Yes i am still stuck in the time (1972 -IBM IV Fortran v 4.3) and the we used linprinters maxtrix printer style with tractored paper.
I'll use a file and print it later.

Kindly .
McTes

Re: How to print to my Brother printer in Fortran 77

Long ago, computer operators (those who changed the paper in the printer and mounted the required Tapes and Discs) were considered "robots" by programmers and programmers were considered idiots by computer operators; two different worlds.

Somehow, I was allowed to bridge the swinging door boundary and enter the holy computer room to retrieve my green bar printout. The printouts came from a chain printer and fell into a box. A curved, thick wire grid, behind the printer, encouraged the paper to fan fold. The cognoscenti knew how to hold the printout at the perforation and flick it with their index finger to start the tear.

"Tear" is a good word because when I did it, I misjudged the distance from the paper to the wire grid behind it. When my finger broke though the perforation and solidly struck the metal grid, you could hear the "TWANG" across the room. Everyone went silent; there was only the hum of electronics. My eyes started to water (tear up). I gathered my printout and in my best, "I meant to do that." made my way to the door. It was only when I was on the other side, and the door was swinging shut, that the computer room erupted in laughter.

It's okay. It doesn't bother me. It was only 56 years ago. 😀