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: 74: 75: 76: 77: 78: 79: 80: 81: 82:
| procedure Tmain.GridrefreshTimer(Sender: TObject); var pathname : string; f,f1 : Textfile; s,sa, sb, datestamp, timestamp, barcode : string; a, i, index, gr, nr, obj, laenge, position, position1 : integer; gr_p, nr_p : real;
begin a := 1; i := 3; index := 1; gr := 0; nr := 0; obj:= 0; pathname := filepath.Text;
if not FileExists(pathname) then begin AssignFile(f, pathname); ReWrite(f); CloseFile(f); end;
if single.Checked = true then begin if Grid1.ColCount >= 3 then begin databox.Lines.SaveToFile(pathname); AssignFile(f1, pathname); reset(f1);__________________________________________________________hier kommt die Fehlermeldung. Line 499 while not eof(f1) do begin readLn(f1, s); datestamp := Copy(s,1,10); Grid1.Cells[0,a] := InttoStr(Index); Grid1.Cells[1,a] := datestamp;
laenge := Length(s); Position := Pos('-->',s); Position1 := Pos(';',s); Grid1.Cells[2,a] := Copy(s,Position1 + 1, position-position1-1); Grid1.Cells[i,a] := Copy(s,Position + 3, laenge-position); a := a + 1; index := index + 1;
if runstat.Caption = 'running' then begin barcode := Copy(s,Position + 3, laenge-position); obj := obj + 1; objects.Caption := IntToStr(obj); if barcode = noread.Text then begin nr := nr +1; nr2.Caption := IntToStr(nr); end;
if (barcode <> noread.Text) and (barcode <> '') then begin gr := gr +1; gr2.Caption := IntToStr(gr); end;
nr_p := 100/obj * nr; STR(nr_p:3:2, sa); nr1.Caption := sa +'%';
gr_p := 100/obj * gr; STR(gr_p:3:2, sb); gr1.Caption := sb +'%';
combi1.Caption := gr1.Caption;; combi2.Caption := inttostr(gr);
end;
end; CloseFile(f1); end; end;
end; |