17-02-2021, 05:49 PM
بارك الله فيك اخي محمد عبد العزيز جاري التجربة ...
[size=small]محمد عبد العزيز[/size]
[quote pid="52781" dateline="1613568194"]
السلام عليكم
حل على السريع... ليس أنيق لكنه يفي بالغرض.
[/quote]
![[صورة: 554132660.png]](https://www8.0zz0.com/2021/02/17/20/554132660.png)
[size=small]محمد عبد العزيز[/size]
[quote pid="52781" dateline="1613568194"]
السلام عليكم
حل على السريع... ليس أنيق لكنه يفي بالغرض.
كود :
Var
NN: Boolean;
Max, i,j,k,m : integer;
St: String;
begin
ListBox1.Clear;
Max:= StringGrid1.RowCount-1;
For i:=1 to Max Do begin
K:=1;NN:=False;
For j:=i+1 to Max Do
if StringGrid1.Cells[1, i]=StringGrid1.Cells[1, j] then inc(k);
if K>1 then begin
For m:=0 to ListBox1.Items.Count-1 do
if copy(ListBox1.Items[m],1,pos('=',ListBox1.Items[m])-1)=StringGrid1.Cells[1,i] then NN:=True;
if not NN then ListBox1.Items.Add(StringGrid1.Cells[1,i]+'='+IntToStr(k));
end;
end;
//////////////////////////////////////
ListBox2.Clear;
For i:=1 to Max Do begin
K:=1;NN:=False;
For j:=i+1 to Max Do
if StringGrid1.Cells[3, i]=StringGrid1.Cells[3, j] then inc(k);
if K>1 then begin
For m:=0 to ListBox2.Items.Count-1 do
if copy(ListBox2.Items[m],1,pos('=',ListBox2.Items[m])-1)=StringGrid1.Cells[3,i] then NN:=True;
if not NN then ListBox2.Items.Add(StringGrid1.Cells[3,i]+'='+IntToStr(k));
end;
end;
end;[/quote]
![[صورة: 554132660.png]](https://www8.0zz0.com/2021/02/17/20/554132660.png)
تمت التجربة 
جزاك الله كل خير [size=small]أخي الكريم محمد عبد العزيز [/size]
جاري فهم الكود السريع ..


جزاك الله كل خير [size=small]أخي الكريم محمد عبد العزيز [/size]
جاري فهم الكود السريع ..
