早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求fortranError:Notavalidvalueforthechar-exprinthisconnect-spe怎么解决?for(13):Error:Notavalidvalueforthechar-exprinthisconnect-spec.['readonly']13行是这句open(unit=1,file='d:\cmap\cmapmonv110179.txt',access='sequenti

题目详情
求fortran Error:Not a valid value for the char-expr in this connect-spe怎么解决?
for(13) :Error:Not a valid value for the char-expr in this connect-spec.['readonly']
13行是这句 open (unit=1,file='d:\cmap\cmap_mon_v1101_79.txt',
access='sequential',status='readonly',form='formatted')
Error:Constants and expressions are invalid in read-only I/O lists.[RLONRAIN1]
▼优质解答
答案和解析
status
Character*(*).Describes the nature of the file to be opened.Can be one of the following:
●'OLD' The file must already exist.If the file exists,it is opened.If it does not exist,an I/O error occurs.
●'NEW' The file must not already exist.If the file does not exist,it is created.If it exists,an I/O error occurs.
●'SCRATCH' If you omit the file parameter when opening a file,the value of status defaults to 'SCRATCH'.Scratch files are temporary.They are deleted when the unit is closed or when the program terminates.
●'REPLACE' The file opened replaces one of the same name.If there is no existing file of the same name,a new file is created.
●'UNKNOWN' (Default) The run-time system first attempts to open the file with status equal to 'OLD',and then with status equal to 'NEW'.If the file exists,it is opened; if it does not exist,it is created.
●Using STATUS= 'UNKNOWN' avoids any run-time errors associated with opening an existing file using STATUS='NEW' or opening a nonexistent file using STATUS='OLD'.
\x05Values of status affect only disk files,and are ignored for devices such as the keyboard or the printer.
没有发现'readonly'这个选项.