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