1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73:
| ... var f: TextFile; fl1,fl2,fl3:double; i1, i2, i3,lines,steps: integer; da1,da2: tdate; st1,st2,line: string;
begin dat.db_z.sql.text:='SELECT Count (*) AS i3 FROM zinssatz'; dat.db_z.ExecSQL; dat.db_z.Open; if dat.db_z.IsEmpty = true then i1:=0 else i1:=dat.db_z.fields[0].asinteger; if wordia.Execute then begin AssignFile(f, wordia.FileName); Reset(f); lines := 0; while not eof(f) do begin Readln(f, line); lines := lines + 1; end; CloseFile(f); steps := lines div 10; Reset(f); Readln(f, line); Readln(f, line); i2 := strtoint(copy(line,9,3)); if i2 > i1 then begin Save_Cursor := Screen.Cursor; Screen.Cursor := crSQLWait; Readln(f, line); while not eof(f) do begin fl1:=0; fl2:=0; fl3:=0; Readln(f, line); da1:= StrTodate(copy(line,1,10)); da2:= StrTodate(copy(line,12,10)); fl1:= StrToFloat(copy(line,23,5)); fl2:= StrToFloat(copy(line,29,5)); st1:= copy(line,35,20); fl3:= StrToFloat(copy(line,56,5)); st2:= copy(line,62,20); dat.db_z.SQL.Text:='SELECT Count (*) AS i3 FROM table where zab = '+Quotedstr(datetostr(da1)); dat.db_z.ExecSQL; if dat.db_z.IsEmpty = true then begin dat.db_z.sql.text:='SELECT * FROM table'; dat.db_z.ExecSQL; dat.db_z.Open; dat.db_z.ReadOnly:=false; dat.db_z.Insert; dat.db_z.fieldbyname('basis').Asfloat:= fl1; dat.db_z.fieldbyname('zab').AsDateTime:= da1; dat.db_z.fieldbyname('zbis').AsDateTime:= da2; dat.db_z.fieldbyname('prizins').asfloat:= fl2; dat.db_z.fieldbyname('prizinspara').AsString:= st1; dat.db_z.fieldbyname('buszins').AsFloat:= fl3; dat.db_z.fieldbyname('buszinspara').asstring:= st2; dat.db_z.fieldbyname('gesprizins').AsFloat:= fl2; dat.db_z.fieldbyname('gesbuszins').asfloat:= fl3; dat.db_z.post; end; end; end; dat.db_z.sql.text:='SELECT * FROM table'; dat.db_z.Open; Screen.Cursor := Save_Cursor; end; |