Question about printing with FORTRAN

  • Context: Fortran 
  • Thread starter Thread starter DoktorD
  • Start date Start date
  • Tags Tags
    Fortran Printing
Click For Summary
SUMMARY

Printing output directly to a local printer using FORTRAN code is possible, but it depends on the specific compiler and operating system in use. Historically, an I/O unit number, often 3, was associated with line printers, allowing commands like WRITE (3, 20) to send output to the printer. Modern implementations require checking the compiler's manual for options in the OPEN statement to link a unit number with the printer driver. This approach varies across different compilers and operating systems.

PREREQUISITES
  • Familiarity with FORTRAN programming language
  • Understanding of I/O operations in FORTRAN
  • Knowledge of compiler-specific documentation
  • Basic concepts of printer drivers and local printing
NEXT STEPS
  • Review the documentation for your specific FORTRAN compiler regarding printer I/O options
  • Explore the OPEN statement in FORTRAN for associating unit numbers with devices
  • Investigate modern printer drivers and their compatibility with FORTRAN
  • Learn about handling output streams in FORTRAN for different devices
USEFUL FOR

FORTRAN developers, systems programmers, and anyone interested in integrating printing capabilities into FORTRAN applications.

DoktorD
Messages
6
Reaction score
0
Hey guys,

I tried looking around on the web and came back without much luck..

Is it possible to print FORTRAN output using FORTRAN code? When I say "print," I mean to a local printer such as a laserjet.. not just printing to the terminal screen..

I've searched pretty intensely on the internet, but haven't found much at all.. I was hoping you guys could at least point me in the right direction.

Thanks!
 
Technology news on Phys.org
Once upon a time, when I learned Fortran more than 35 years ago, a certain I/O unit number was always associated with the "line printer," I think it was 3, so you could write something like WRITE (3, 20) FOO, BAR to write to the printer. But that was in the days of hard-wired printers and before software-based printer interfaces (drivers).

Your compiler might have an option available in the OPEN statement that allows you to associate a unit number with a locally-connected printer, or more properly, with its printer driver. You'll have to look in your compiler's manual. It's probably compiler- and OS- specific.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
12K
Replies
12
Views
9K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
138K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K