Manual Reference Pages  - is_iostat_eor (3fortran)

NAME

IS_IOSTAT_EOR(3) - [STATE:INQUIRY] Test for end-of-record value

SYNOPSIS

result = is_iostat_eor(i)

         elemental integer function is_iostat_eor(i)

integer(kind=KIND),intent(in) :: i

CHARACTERISTICS

o I is integer of any kind
o the return value is a default logical

DESCRIPTION

IS_IOSTAT_EOR(3) tests whether a variable has the value of the I/O status "end of record". The function is equivalent to comparing the variable with the IOSTAT_EOR parameter of the intrinsic module ISO_FORTRAN_ENV.

OPTIONS

o I : The value to test as indicating "end of record".

RESULT

Returns .true. if and only if I has the value which indicates an end-of-record condition for iostat= specifiers, and is .false. otherwise.

EXAMPLES

Sample program:

    program demo_is_iostat_eor
    use iso_fortran_env, only : iostat_eor
    implicit none
    integer :: inums(5), lun, ios

! create a test file to read from open(newunit=lun, form=’formatted’,status=’scratch’) write(lun, ’(a)’) ’10 20 30’ write(lun, ’(a)’) ’40 50 60 70’ write(lun, ’(a)’) ’80 90’ write(lun, ’(a)’) ’100’ rewind(lun)

do read(lun, *, iostat=ios) inums write(*,*)’iostat=’,ios if(is_iostat_eor(ios)) then stop ’end of record’ elseif(is_iostat_end(ios)) then print *,’end of file’ exit elseif(ios.ne.0)then print *,’I/O error’,ios exit endif enddo

close(lun,iostat=ios,status=’delete’)

end program demo_is_iostat_eor

Results:

     >  iostat=           0
     >  iostat=          -1
     >  end of file

STANDARD

Fortran 2003

SEE ALSO

o associated(3) - Association status of a pointer or pointer/target pair
o extends_type_of(3) - Determine if the dynamic type of A is an extension of the dynamic type of MOLD.
o is_iostat_end(3) - Test for end-of-file value
o is_iostat_eor(3) - Test for end-of-record value
o present(3) - Determine whether an optional dummy argument is specified
o same_type_as(3) - Query dynamic types for equality
Fortran intrinsic descriptions


Nemo Release 3.1 is_iostat_eor (3fortran) November 02, 2024
Generated by manServer 1.08 from d664f7b6-32d8-4e06-8be1-239225d09126 using man macros.