May be I should discribe the problem in detail.
There is a program with a lot of statements like the following:
do while(.not. EOF(1))
READ(1,'(A)') Tmp
end do
But the intrinsic funcion EOF does not exist. So, it is necessary to
write EOF function to make the program work. I tried the following
function:
logical function EOF(Unit)
integer, intent(in) :: Unit
integer ErrCode
INQUIRE(Unit, iostat=ErrCode)
if (ErrCode<0) then
EOF = .true.
else
EOF = .false.
end if
end function EOF
But after reading the last record in the file checking the file with this
EOF function returns .false. As a result "READ" reads after the end of
file and error occurs.
> -----Original Message-----
> >Hello!
> >In Microsoft extension to ANSI Fortran 90 standart there are intrinsic
> >EOF function. Is it possible to write similar function in fortran
> >language for IRIX and HP machines? I tried to check the file with
IQIURE
> >and READ functions, but it seems that they are not suitable for this
> >task.
> >Darima.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|