Hi All,
I have a small issue that I hope someone might be able to shed some light
upon.
I'm trying to get more familiar with Fortran, and was attempting to open a
flat 80 byte permanent ascii file.
I can get the file open ok, but when I come to print the lines to the
screen, I seem to be missing the 1st character of each line.
Given the following code :-
------------------------- SNIPPET -------------
INTEGER*4 RECLEN, RECBUFF, FSTAT, FNUM
CHARACTER*80 RECBUFF
DATA RECLEN /-80/
(file opened prior to here OK)
FSTAT=FREAD(FNUM,RECBUFF,RECLEN)
DO WHILE (FSTAT .NE. 0)
PRINT '(A80)',RECBUFF
FSTAT=FREAD(FNUM,RECBUFF,RECLEN)
ENDDO
------------------------- SNIPPET -------------
If I change the PRINT statement to A81, it cures the problem, although I'd
rather I knew why it cured it :)
If there are any of the 'dying breed'? out there, I'd really appreciate some
info.
Of course, it might be related to the FREAD intrinsic, whatever the
language, and not just Fortran.
Thanks (as ever),
Kevin
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Kevin O'Sullivan Cosworth Racing Limited, -
- Racing Systems Department The Octagon, -
- St James Mill Road, -
- Northampton, England, -
- NN5 5RA. -
- Tel: +44 (0) 1604 598488 -
- mailto:[log in to unmask] Fax: +44 (0) 1604 598506 -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The views expressed above are mine entirely and in no way represent
those of my employer.
********************************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the email administrator - [log in to unmask]
********************************************************************************
|