Re: fmt: read unexpected character
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Mon, 15 Dec 2008 12:02:18 -0800
Wolfi <sfsdf.dfdsf@xxxxxxxxx> wrote:
if (line(i:i+3) .eq. 'rows') then.....
read (line(i+4:i+6),1011) maxline *HERE IS LINE 23
1011 format (i3)
At line 23 of file Begin.redhat.f
Fortran runtime error: Bad value during integer read
As others have noted, the problem here appears to have much more to do
with the portability of the non-Fortran elements of the code than with
Fortran. This code looks for an integer in the 3 characters imediately
following the string "rows" in the output of stty. That actually seems a
bit questionable in robustness for any OS. If the number of rows is more
than 99, as is plausible enough, should one expect 3 characters jammed
right up against the label as in "rows100"? That's what it looks like
this code expects.
When I run stty -s on this Mac, I see an output that looks like "rows;
100". That is the two characters immediately following "rows" are a
semicolon and a blank. Odds are that the semicolon is what your message
is complaining about, as a semicolon indeed is not a valid character in
an integer value.
Without spending more time researching the exact specs for stty, I'd be
reluctant to guarantee any particulat column numbers. For example, I
don't know whether the output would be shifted over by a column or not
if my number of rows took only 2 digits. If it were my code, I'd
probably try to pick out the numeric field by using blanks as
delimitters instead of by hard-wiring exact columns.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: fmt: read unexpected character
- From: Wolfi
- Re: fmt: read unexpected character
- References:
- fmt: read unexpected character
- From: Wolfi
- Re: fmt: read unexpected character
- From: Dave Allured
- Re: fmt: read unexpected character
- From: Wolfi
- fmt: read unexpected character
- Prev by Date: Re: compiler bug?
- Next by Date: Re: compiler bug?
- Previous by thread: Re: fmt: read unexpected character
- Next by thread: Re: fmt: read unexpected character
- Index(es):
Relevant Pages
|