Manual Reference Pages  - is_iostat_end (3fortran)

NAME

IS_IOSTAT_END(3) - [STATE:INQUIRY] Test for end-of-file value

SYNOPSIS

result = is_iostat_end(i)

         elemental logical function is_iostat_end(i)

integer,intent(in) :: i

CHARACTERISTICS

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

DESCRIPTION

IS_IOSTAT_END(3) tests whether a variable (assumed returned as a status from an I/O statement) has the "end of file" I/O status value.

The function is equivalent to comparing the variable with the IOSTAT_END parameter of the intrinsic module ISO_FORTRAN_ENV.

OPTIONS

o I : An integer status value to test if indicating end of file.

RESULT

returns .true. if and only ifI has the value which indicates an end of file condition for IOSTAT= specifiers, and is .false. otherwise.

EXAMPLES

Sample program:

    program demo_iostat
    implicit none
    real               :: value
    integer            :: ios
    character(len=256) :: message
       write(*,*)’Begin entering numeric values, one per line’
       do
          read(*,*,iostat=ios,iomsg=message)value
          if(ios.eq.0)then
             write(*,*)’VALUE=’,value
          elseif( is_iostat_end(ios) ) then
             stop ’end of file. Goodbye!’
          else
             write(*,*)’ERROR:’,ios,trim(message)
             exit
          endif
          !
       enddo
    end program demo_iostat

STANDARD

Fortran 2003

SEE ALSO

****(3)

fortran-lang intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 is_iostat_end (3fortran) April 28, 2024
Generated by manServer 1.08 from adf41cb5-e465-44fa-9c2b-19c4f36bde14 using man macros.