保存到Ini,从Ini读出:<br><br>procedure WriteToIni(const iniFileName:string;const Section:string);<br>var<br> iniFile:TIniFile;<br> iCol,iRow:integer;<br> s:string;<br>begin<br> if(Section = '') then exit;<br><br> IniFile := TIniFile.create(ExtractFilePath(ParamStr(0))+ iniFileName);<br><br> if(iniFile = nil) then exit;<br><br> iniFile.EraseSection(Section);<br><br> for iRow := 1 to 64 do<br> begin<br> for iCol := 1 to 64 do<br> begin<br> s := IntToStr(iCol) + '_' + IntToStr(iRow);<br> iniFile.WriteInteger(Section,s,T[iCol,iRow]);<br> end;<br> end;<br><br> iniFile.Free;<br>end;<br><br>procedure ReadFromIni(const iniFileName:string;const Section:string);<br>var<br> iniFile:TIniFile;<br> i,iPos,iCol,iRow:integer;<br> name,value:string;<br> values:TStringList;<br>begin<br> if(Section = '') then exit;<br><br> IniFile := TIniFile.create(ExtractFilePath(ParamStr(0))+ iniFileName);<br><br> if(iniFile = nil) then exit;<br><br> values := TStringList.Create;<br><br> iniFile.ReadSectionValues(Section,values);<br> iniFile.Free;<br><br> for i:= 0 to values.Count - 1 do<br> begin<br> iPos := Pos('=',values);<br> name := Copy(values,1,iPos - 1);<br> value := Copy(values,iPos + 1,Length(values) - iPos);<br><br> iPos := Pos('_',name);<br> iCol := StrToInt(Copy(name,1,iPos - 1));<br> iRow := StrToInt(Copy(name,iPos + 1,Length(name) - iPos));<br><br> T[iCol,iRow] := StrToInt(value);<br> end;<br><br> values.Free;<br>end;<br>