//这样: var s: String; c: Integer; begin s := MyIniFile.ReadString('结束', '节数', s); c := StrToInt(s); for i := 0 to c-1 do ......
----------------------------------------------
-
procedure TForm1.tbtnOpenClick(Sender: TObject); var myinifile :Tinifile; i:integer; c:string; begin openDialog.Title :='打开脚本'; openDialog.Filter := 'COA files (*.coa)|*.coa'; if OpenDialog.Execute then begin myinifile :=Tinifile.Create(OpenDialog.FileName); edtProname.Text:=myinifile.ReadString('文件选项','文件名',''); c:=myinifile.ReadString('结束','节数','');
for i:=0 to strToint(c)-1 do begin lstAddress.Items[i].Caption :=myinifile.ReadString(intTostr(i),'偏移地址','');//到这句就有错!晕死了!
for i:=0 to strToint(c)-1 do begin with lstAddress.Items.Add do begin c:=myinifile.ReadString(intTostr(i),'偏移地址',''); //showmessage(c); Caption :=c; end; end; OK了,谢谢lovedelphi1 !
----------------------------------------------
-