S
sxd2002
Unregistered / Unconfirmed
GUEST, unregistred user!
begin
if fileexists('c:/temp/aaa.txt') then begin
FlatButton2.Enabled:=false;
Screen.Cursor:=CrhourGlass;
adotable1.Connection:=ADOConnection1;
adotable1.TableName:='tzdb';
adotable1.Active:=true;
adotable1.Edit;
lines:=Tstringlist.Create;
lines.LoadFromFile('c:/temp/aaa.txt');
for i:=0 to pred(lines.Count-1) do begin
adotable1.Append;
s:=lines;
s2:=copy(s,10,16);
adotable1.FieldByName('xh').Value:=s2;
s2:=copy(s,29,6);
adotable1.FieldByName('xm').Value:=s2;
s2:=copy(s,72,14);
adotable1.FieldByName('dfe').Value:=s2;
s2:=copy(s,97,8);
adotable1.FieldByName('fdz').Value:=s2;
...
******************************************************
由于aaa.txt的行数很长,在append的时候时间较长,我想用
progressbar显示完成的进度,由于本人对progressbar很陌生
请高手给点源码;或者还有什么好的进度显示方法;
if fileexists('c:/temp/aaa.txt') then begin
FlatButton2.Enabled:=false;
Screen.Cursor:=CrhourGlass;
adotable1.Connection:=ADOConnection1;
adotable1.TableName:='tzdb';
adotable1.Active:=true;
adotable1.Edit;
lines:=Tstringlist.Create;
lines.LoadFromFile('c:/temp/aaa.txt');
for i:=0 to pred(lines.Count-1) do begin
adotable1.Append;
s:=lines;
s2:=copy(s,10,16);
adotable1.FieldByName('xh').Value:=s2;
s2:=copy(s,29,6);
adotable1.FieldByName('xm').Value:=s2;
s2:=copy(s,72,14);
adotable1.FieldByName('dfe').Value:=s2;
s2:=copy(s,97,8);
adotable1.FieldByName('fdz').Value:=s2;
...
******************************************************
由于aaa.txt的行数很长,在append的时候时间较长,我想用
progressbar显示完成的进度,由于本人对progressbar很陌生
请高手给点源码;或者还有什么好的进度显示方法;