home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / fortran / 2998 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.7 KB  |  33 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!sun-barr!ames!news.hawaii.edu!galileo!tholen
  3. From: tholen@galileo.ifa.hawaii.edu (Dave Tholen)
  4. Subject: programming style question
  5. Message-ID: <1992Aug12.193739.23817@news.Hawaii.Edu>
  6. Sender: root@news.Hawaii.Edu (News Service)
  7. Nntp-Posting-Host: galileo.ifa.hawaii.edu
  8. Organization: University of Hawaii
  9. Date: Wed, 12 Aug 1992 19:37:39 GMT
  10. Lines: 21
  11.  
  12. A question about programming style:  How many of you explicitly OPEN
  13. preconnected units, which nowadays usually mean standard input, standard
  14. output, and sometimes standard error (typically units 5, 6, and 0)?  In
  15. the old days, 5 and 6 were often card reader and printer.  I haven't
  16. been doing so myself, but the question came up recently because I've
  17. started using a new 32-bit OS/2 compiler that preconnects standard input
  18. and standard output, but not standard error, whereas the old 16-bit OS/2
  19. compiler preconnected all three.  To get standard error, I need to add
  20. an explicit OPEN, and I'm debating about adding explicit OPENs for all
  21. three.  While thinking about it, the following thoughts have occurred.
  22. If OPENing standard output, what good is trapping an ERR= condition,
  23. because there is no output device to which an error message can be
  24. written?  Of course, one could use the STOP 'Error message here'
  25. construct to get around this problem.  Also, in the PC world, to get
  26. these three connected to the keyboard and screen, all three would OPEN
  27. FILE='CON'.  At first, this looks like a violation of the FORTRAN 77
  28. standard, because a file can be connected to only one unit at a time,
  29. but even though the devices have the same name, I presume they are
  30. treated as different logical devices to be standard conforming.
  31.  
  32. I'd appreciate more comments!
  33.