آماتور دلفی
شنبه 18 دی 1389, 14:00 عصر
اولا خسته نباشید . دوما من یه مشکل دارم توی وایل زیر باید کل وایل بره تا متغیر mab رو حساب کنم ولی اگه وایل تموم شد و اون شرط اخرش درست نبود میخام این تغییرات توی کوری اعمال نشه . ایا راه حلی هست ؟
while not eof(f) do
begin
readln(f,e);
if e<>'' then
begin
t:=t+1;
i:=strtoint64(copy(e,19,15));
mab:=mab+i ;
Query2.close;
Query2.SQL.Clear;
Query2.SQL.Add('insert into tajmi.db ');
Query2.SQL.Add('(rad,hes,mab,cod)');
Query2.SQL.Add(' values (');
Query2.SQL.Add(' '''+copy(e,1,5)+''',');
Query2.SQL.Add(' '''+copy(e,6,13)+''',');
Query2.SQL.Add(' '''+copy(e,19,15)+''',');
Query2.SQL.Add(' '''+s+''')');
Query2.ExecSQL;
end; //if
end;//while
if mab<>mabk then
showmessage('اینجا اگه اومد توی این قسمت باید تغییرات اعمال نشه !! ');
if t<>tk then
showmessage('و همینطور اینجا!!! ');
while not eof(f) do
begin
readln(f,e);
if e<>'' then
begin
t:=t+1;
i:=strtoint64(copy(e,19,15));
mab:=mab+i ;
Query2.close;
Query2.SQL.Clear;
Query2.SQL.Add('insert into tajmi.db ');
Query2.SQL.Add('(rad,hes,mab,cod)');
Query2.SQL.Add(' values (');
Query2.SQL.Add(' '''+copy(e,1,5)+''',');
Query2.SQL.Add(' '''+copy(e,6,13)+''',');
Query2.SQL.Add(' '''+copy(e,19,15)+''',');
Query2.SQL.Add(' '''+s+''')');
Query2.ExecSQL;
end; //if
end;//while
if mab<>mabk then
showmessage('اینجا اگه اومد توی این قسمت باید تغییرات اعمال نشه !! ');
if t<>tk then
showmessage('و همینطور اینجا!!! ');