- 积分
 - 89
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2013-5-5
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
do 30 a=1,c/2 
      final_file_na(1)=file_name(2*a-1)//end_name 
      open(100,file=final_file_na(1))  
      read(100,*,IOSTAT=istat) 
      if(istat/=0) then 
         kongfile=kongfile+1 
         close(100) 
         goto 60 
      end if 
      close(100) 
         . 
         . 
         . 
         . 
60    final_file_na(2)=file_name(2*a)//end_name 
      open(102,file=final_file_na(2))  
      read(102,*,IOSTAT=istat) 
      if(istat/=0) then 
         kongfile=kongfile+1 
         close(102) 
         goto 30 
      end if 
      close(102) 
         . 
         . 
         . 
         . 
end do 
  每次循环中,打开两个文件进行处理(程序中只列出打开文件部分,处理部分省略)。每次打开文件时先判断是否为空。打开第一个文件 
时若为空,即istat/=0,则直接跳过下面程序,跳到打开第二个文件,如goto 60。如果打开第二个文件还是为空,则下面程序不做,直接进 
入下一次循环。这里第二次打开文件,判断为空时跳入下一次循环的程序是否正确? 
     if(istat/=0) then 
         kongfile=kongfile+1 
         close(102) 
         goto 30 
      end if 
 |   
 
 
 
 |