Dear colleagues,
What is wrong with the following program?
Winapp
Program Test79
Implicit None
Integer , Dimension (10) :: n
Integer :: i
Character (len=20), Dimension (10) :: Buffer
Buffer (1) = '1 , 2'
Buffer (2) = '3 , 4, 5'
Buffer (3) = '6'
Read ( Buffer, * ) ( n (i), i = 1,5 )
Read ( Buffer, * ) n (6)
write (*,*) ( n (i), i = 1,5 )
write (*,*) n (6)
! ----------------------------------------
Open (Unit = 10, File = 'Input')
Read ( 10, * ) ( n (i), i = 1,5 )
Read ( 10, * ) n (6)
write (*,*) ( n (i), i = 1,5 )
write (*,*) n (6)
End Program Test79
The program reads Buffer (1) and Buffer (2) correctly by an implied-do loop but fails reading Buffer (3). If Buffer is put into a file, reading is (of course) correct.
File Input:
1 , 2
3 , 4, 5
6
Best regards,
- Lassmann