如题,有数组aryValue[10,10],请问如何将该数组中每个元素的值保存到文本文件中?
要求每行的元素之间用制表符分隔。
谢谢!

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var aryValue:array[0..9] of array[0..9] of Integer;
      i,j:Integer;
      strList:TstringList;
    begin
      strList:=TStringlist.Create;
      try
        for i := 0 to 9 do
        begin
          strList.Add('');
          for j := 0 to 9 do
          begin
            if j=0 then
              strList[i]:=Inttostr(aryValue[i][j])
            else
              strList[i]:=strList[i]+'|'+Inttostr(aryValue[i][j])
          end;
        end;
        strList.SaveToFile('d:\aaa.txt');
      finally
        strList.Free;
      end;end;
      

  2.   

    谢谢kaguo!
    能不能具体一点?
    麻烦把整个写文本文件的过程写一下。
      

  3.   

    strList:TstringList;
    strList:=TStringlist.Create;
    很简单的
    strList.SaveToFile('d:\aaa.txt');
    就一句写文件