! 学習目的:バイナリーファイル(form='unformatted') ! ex708.f implicit real*8 (a-h,o-z) open(10,file='ex708.txt',form='unformatted') do x=0.d0,1.d0,0.1d0 write(10) x,x**2 end do close(10) open(10,file='ex708.txt',form='unformatted') 10 read(10,end=999) x,x2 !バイナリーファイルは読むことができないので,書き込み時の書式を把握している必要がある. write(*,*) x,x2 goto 10 999 close(10) stop end