Re: closing unit=5 and unit=6 and print *
- From: "Dylan Sung" <dylanwhs.tsktsktsk@xxxxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 15:28:06 +0100
"Tim Prince" <timothyprince@xxxxxxxxxxxxx> wrote in message
news:MIXIg.3726$tU.1213@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Dylan Sung wrote:
| > I've noticed what seems to be a bug in the g77 compiler that comes with
| > Lepsh's Force 2.0 Editor and Compiler. If you open files using the unit
| > numbers 5 and 6, and then later close them, you cannot use 'print *' to
| > output messages to the screen dos console window. Later, altering those
unit
| > numbers to 7 and 8 for the filenames I wanted to use, the print * ouput
| > worked again.
| >
| > After some reading, it seems to me if I've understood it correctly, that
| > unit numbers 5 and 6 are used for screen or device driven input and
output
| > in f77. Can anyone elaborate on this, and is this a general f77 thing or
| > specific to the build of g77 I have been using?
|
| According to my understanding, in f77 and subsequent standards, unit=*
| is required to be independent of positive numbered units in the
| available contiguous range. Prior to f77, as unit=* was not generally
| available, the substitution of pre-assigned units 5 and 6 was usual
| practice (never codified as a standard). If you check the record of
| c.l.f, you will see repeated expert advice not to use single digit
| units, for just such reasons, regardless of the standard.
| It may be tempting to use units 5 and 6 in the expectation that they
| will be pre-assigned in this fashion, while allowing the program to
| redirect at will. Such a practice would be less portable than using
| unit=* and relying on the redirection supported by most operating systems.
I guess my own programming bad habits have to include single digit file unit
numbers. I've tried with larger unit numbers, but there seems to be a limit
on them as well.
| As g77 has not been maintained for some time, correction of such a
| problem in that compiler is not to be expected.
I've gathered as much from reading the documentation. Maybe I'll learn f90
or f95 someday, but f77 has done fine for my needs so far.
Thanks to everyone for their views and insights.
Dyl.
.
- References:
- closing unit=5 and unit=6 and print *
- From: Dylan Sung
- Re: closing unit=5 and unit=6 and print *
- From: Tim Prince
- closing unit=5 and unit=6 and print *
- Prev by Date: Re: Overload problem
- Next by Date: Reading Cray binary on linux
- Previous by thread: Re: closing unit=5 and unit=6 and print *
- Next by thread: Overload problem
- Index(es):
Relevant Pages
|