Вниз
Скачать: CL | DM;

Сравнить два списка. Как?   Найти похожие ветки 

 
Semen   (2003-05-02 16:54) [0]

Имеется два заполненных ListBox. В третий ListBox вывожу те элементы, которые имеются в обоих так:
procedure TForm1.Button1Click(Sender: TObject);
var n,m:integer;
begin
ListBox3.Clear;
For n:=ListBox1.Items.Count-1 downto 0 do
for m:=ListBox2.Items.Count-1 downto 0 do
begin
if ListBox2.Items[m]=ListBox1.Items[n] then
ListBox3.Items.Add(ListBox2.Items[m])
end;
end;

Как мне теперь вывести в третий ListBox те элементы,которые есть в первом и нет во втором ListBox"е.


 
MsGuns ©   (2003-05-02 17:06) [1]

LB3.Items.Clear
for i:=0 to LB1.Count-1 do
if LB2.Items.IndexOf(LB1.Items[i])<0 then
LB3.Items.Add(LB1.Items[i])



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.013 c
1-46722
Сергеич
2003-05-04 19:55
2003.05.15
ХЕЛП! Открытие файлов.


1-46708
Rocker
2003-05-04 10:04
2003.05.15
Резидентная программа


14-46953
yoyoyo
2003-04-26 17:04
2003.05.15
DGlut.pas


3-46571
Alexis
2003-04-22 18:45
2003.05.15
CachedUpdates, ApplyUpdates & exceptions


4-47057
malkolinge
2003-03-14 13:36
2003.05.15
Надо картинку нарисовать !




   Наверх