2 ! PR29277 Stream IO test 11, tests formatted form.
3 ! Contributed by Tobias Burnas.
6 character(len=*), parameter :: rec1 = 'record1'
7 character(len=*), parameter :: rec2 = 'record2'
8 character(len=50) :: str1,str2
12 open(10,form='formatted',access='stream',&
13 status='scratch',position='rewind')
14 write(10,'(a)') rec1//new_line('a')//rec2
18 if(str1 /= rec1 .or. str2 /= rec2) call abort()
22 if(str1 /= rec1 .or. str2 /= rec2) call abort()
25 open(10,form='formatted',access='stream',&
26 status='scratch',position='rewind')
27 write(10,*) '123 '//trim(rec1)//' 1e-12'
28 write(10,*) '12345.6789'
32 if(i /= 123 .or. str1 /= rec1 .or. r /= 12345.6789) &
36 open(unit=10,form='unformatted',access='stream', &
37 status='scratch',position='rewind')
38 write(10) rec1//new_line('a')//rec2
39 len = len_trim(rec1//new_line('a')//rec2)
42 if(str1 /= rec1//new_line('a')//rec2) call abort()
43 end program stream_test