扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:xm4014 来源:论坛 2007年10月31日
关键字:
procedure TPgCSV.CSVToDataSet; begin … FDataset.DisableControls; while (not Eof(FFile)) and (not FStop) do begin //read from CSV Readln(FFile,RecordString); //xm4014's modification if Assigned(FRegulateString) then FRegulateString(self,RecordString); //add new record try FDataset.Append; //应该加在这儿! //xm4014's modification if Assigned(FAfterInsert) then AfterInsert(self,FDataset); … for i:=1 to CountMapItems do … end; |
//xm4014's modification property CSVRecordCount : integer read FCSVRecordCount write FCSVRecordCount default 0; |
property CSVFile : string read FCSVFile write FCSVFile; |
property CSVFile : string read FCSVFile write SetCSVFile; |
procedure TPgCSV.SetFCSVFile(const Value: string); var F1:TextFile; iCount:integer; begin if FCSVFile<>Value then begin FCSVFile := Value; //文件名一换,就重新扫描,改变FCSVRecordCount的值 if FileExists(Value) then begin AssignFile(F1, Value); Reset(F1); iCount:=0; while not Eof(F1) do begin ReadLn(F1); Inc(iCount); end; FCSVRecordCount:=iCount; end; end; end; |
ProgressBar1.Min :=0; ProgressBar1.Max:=PgCSV1.CSVRecordCount; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者