the following program does not behave as I would expect:
program test implicit none character(len=100) :: value integer, dimension(100) :: intvalues integer i value = "2 5 69" read(value,*,end=20,err=20) (intvalues(i),i=1,100) 20 i=i-1 write(*,*) i write(*,*) intvalues(:i) end program test
I would expect that the internal read stops at the end of the string and i=3. However, it runs until the end of the implied do-loop. Any suggestions?