procedure TForm1.MILoadClick(Sender: TObject);
var
  Sfile : file of Char;
  C : Char;
  Mystring : string;
begin
  if OpenDialog1.Execute then
     begin
        AssignFile(Sfile,OpenDialog1.FileName);
        //联系文件名与文件句柄
        while not Eof(Sfile) do
        begin
          Read(Sfile,C);
          if C=','then
             begin
             ShowMessage(Mystring);
             //AddrArray[0].Addr:= StrtoInt(Mystring);
             Mystring :=";
             end;
          if C<>'' then
             begin
             Mystring:= Mystring+C;
             end;
        end;     end;
end;

解决方案 »

  1.   

    文件没关闭吧?穷死了.兄弟姐妹们帮帮忙找点兼职工作.(合肥地区和基于网络的都可以)
    --------------------------------------------------------------------据查证 hammer_shi(@农业专家@(*暂时是菜鸟*))为激进分子,该账号已删除.  
      

  2.   

    出错信息:
    Project C.exe raised exeception class EInOutError with message 
    'I/O error 103'.Process stopped. Use Step or Run to continue.这是从一个含有诸如12536,21025,......,145325663的文件中一次读出一个数字
      

  3.   

    出错箭头指向while not Eof(Sfile) do
    并且我该成下面的(关闭了文件)还有错
     if OpenDialog1.Execute then
         begin
            AssignFile(Sfile,OpenDialog1.FileName);
            //联系文件名与文件句柄
            while not Eof(Sfile) do
            begin
              Read(Sfile,C);
              if C=','then
                 begin
                 ShowMessage(Mystring);
                 //AddrArray[0].Addr:= StrtoInt(Mystring);
                 Mystring :='';
                 end;
              if C<>'' then
                 begin
                 Mystring:= Mystring+C;
                 end;
            end;
            CloseFile(Sfile);
         end;
      

  4.   

    还没打开文件呢
    reset(sfile)
      

  5.   

    我知道错在哪里了,
    但改成       if C<>'' and C<>',' then
                 begin
                 Mystring:= Mystring+C;
                 end;
    却出错Operator not applicable to this operand type
      

  6.   

    if (C<>'') and (C<>',') then
      

  7.   

    在Delphi中StrtoInt(Mystring),若Mystring是2147483647结果会正确吗?
    Longint的范围-2147483648~2147483647
    而Integer的范围是-32768~32767