【发布时间】:2018-06-23 20:26:31
【问题描述】:
我有以下简单的 Fortran 程序:
program quotes
implicit none
character*1000 quote
integer*4 i
open(13,file='d:\sp500.new',status='unknown')
close(13,status='delete')
open(12,file='d:\sp500.dat')
open(13,file='d:\sp500.new', status='new')
do 100 i = 1,61113
read(12,'(A)') quote
if(quote[1] .eq. 'I')write(13,'(A)')quote
100 continue
end
我正在尝试读取整个字符串,检查字符串中的第一个字符是否 = 'I',如果为真,则写出整个字符串。我还有其他一些测试要做,所以我需要逐个字符地读取输入字符串
错误信息是:
D:\quotes.f90(18): error FOR3852: syntax error detected between QUOTE and [1]
Error executing fl32.exe.
quotes.obj - 1 error(s), 0 warning(s)
【问题讨论】:
-
所有 Fortran 问题请使用fortran。
-
您使用的是 [] 而不是 ()。正在搜索重复项。
标签: fortran