Hallo lucius,
nur ein Ansatz - ungetestet:
Delphi-Quellcode:
procedure DeleteRow(sg: TStringGrid; iRow: integer);
var
i: integer;
begin
with sg
do begin
if iRow < FixedRows
then
raise Exception.Create('
you cannot delete a fixed row');
for i := Succ(iRow)
to RowCount - 1
do
Rows[i-1].Assign(Rows[i]);
RowCount := RowCount - 1;
end;
end;
procedure DeleteDuplicateRows(sg: TStringGrid);
var
iLow, iHigh: integer;
begin
for iLow := sg.FixedRows
to sg.RowCount - 2
do
for iHigh := Pred(sg.RowCount)
downto Succ(iLow)
do
if sg.Rows[iHigh].Text = sg.Rows[iLow].Text
then
DeleteRow(sg, iHigh);
end;
Grüße vom marabu