I have 2 listview and a timer. This timer captures the records that exist with a particular comment and puts it in the other listview. It turns out that it is repeating the records, I would like it to add only once the record, and check, if already exists the record in the other LISTVIEW, it ignores. What am I doing wrong ? Here is my code:
for I := 0 to Form1.LV1.Items.Count-1 do
begin
if Form1.LV1.Items[I].SubItems[5] = 'OK' then // confere se existe o comentário
begin
Form1.LV2.Visible := True;
L := Form1.LV2.Items.Add;
for J := 0 to Form1.LV2.Items.Count-1 do
if Form1.LV2.Items[J].SubItems[5] <> Form1.LV1.Items[I].SubItems[5] then // aqui tentei fazer não repetir (não deu certo).
Form1.LV2.Items.item[Form1.LV2.Items.count-1] := Form1.LV1.items.item[i];
end;
Any ideas?