相关疑难解决方法(0)

不明显的Delphi语法错误

我有一些简单的代码问题我根本无法解决.我正在使用Delphi 5并应用了所有更新.

我有这个代码块:

procedure TForm1.LoadBtnClick(Sender: TObject);
var
   s1, s2, s3 : Textfile;
   sa, sb, RString, SQLString : string;
begin
  with sourcequery do begin
     Close;
     SQL.Clear;
     SQL.Add('delete * from source');
     ExecSQL;
     Close;
     AssignFile(S2, 'c:\delphi programs\events\source1.txt');
     AssignFile(S1, 'c:\delphi programs\events\source2.txt');
     Reset(s2);
     Reset(s1);
     while not eof(s1) do begin
        readln(s1, RString);
        SQLString := 'insert into source1(f1, f2) values(';
        SQLstring := SQLString+ QuotedStr(copy(Rstring, 1, pos(chr(9), Rstring)-1))+', ';
        SQLString := SQLString+QuotedStr(copy(Rstring, pos(chr(9),Rstring)+1,length(Rstring)))+')';
        with sourcequery do begin
           close;
           SQL.Clear;
           SQL.Add(SQLString);
           ExecSQL;
        end;
     end;
  end;
end;
Run Code Online (Sandbox Code Playgroud)

但是当我尝试编译它时,它会在"eof("之后停止:

 while not …
Run Code Online (Sandbox Code Playgroud)

delphi text-files

0
推荐指数
1
解决办法
287
查看次数

标签 统计

delphi ×1

text-files ×1