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:
| procedure ListeInStringGrid(FN: TFileName; SG: TStringGrid); var i: Integer; S: string; Spalten, Zeilen, CountCols, CountLines, TabPos, StartPos, InitialCol: integer; Liste_String: TStringList; begin Liste_String:= TStringList.Create; try Liste_String.LoadFromFile(FN);
CountLines := Liste_String.Count + SG.FixedRows - 10;
CountCols := 6 + SG.FixedCols;
if CountLines > SG.RowCount then SG.RowCount := CountLines; if CountCols > SG.ColCount then SG.ColCount := CountCols;
InitialCol := SG.FixedCols - 1; Zeilen := SG.FixedRows - 1;
for i := 10 to Liste_String.Count - 1 do begin Spalten := InitialCol; Inc(Zeilen); StartPos := 1; S := Liste_String[i];
TabPos := 16; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 1, 999);
TabPos := 14; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 1, 999);
TabPos := 25; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 6, 999);
TabPos := 11; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 1, 999);
TabPos := 10; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 1, 999);
TabPos := 9; Inc(Spalten); SG.Cells[Spalten, Zeilen] := Copy(S, StartPos, Tabpos); S := Copy(S, TabPos + 1, 999); end; finally Liste_String.Free; end; end; |