I am parsing a dataset and assigning values to TStringList
i want to avoid the duplicates. I use the following code but still duplicates are inserted.
channelList := TStringList.Create;
channelList.Duplicates := dupIgnore;
try
dataset.First;
while not dataset.EOF do
begin
channelList.Add(dataset.FieldByName('CHANNEL_INT').AsString) ;
dataset.Next;
end;
why does the duplicates added?
dataset.FieldByName('CHANNEL_INT')
is slow unsorted operation. Cache it into thevar F: TField
before the loop start