从文件读取并存储在数组中时出现问题
|
使用g96编译器时,出现错误消息:
INTENT(OUT) at variable \'SIZE\' is never set.
下面是我的子例程。您知道如何解决此错误吗?非常感谢!
SUBROUTINE getFileItems(size,itemarray,pricearray,quantityarray)
INTEGER:: iost=0, i=0
INTEGER, INTENT(OUT):: quantityarray(50)
INTEGER, INTENT(OUT):: size
REAL, INTENT(OUT):: pricearray(50)
CHARACTER(20),INTENT(OUT)::itemarray(50)
CHARACTER(20)::namefiletoread
PRINT*,\"Enter the name of file you would like to read: \"
READ*,namefiletoread
OPEN(UNIT=44,FILE = namefiletoread, ACTION = \"READ\", !POSITION=\"REWIND\",IOSTAT=iost)
IF(iost>0)STOP \"Problem opening the file!\"
DO i=1, size
READ(44,\'(A,F6.2,I8)\',IOSTAT=iost), itemarray(i), pricearray(i),quantityarray(i)
IF(iost<0)STOP
END DO
END SUBROUTINE
没有找到相关结果
已邀请:
1 个回复
曝匿弄罚