![]() |
|
استفسار حول القيم المكررة - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : استفسار حول القيم المكررة (/showthread.php?tid=11192) |
RE: استفسار حول القيم المكررة - Ibn Battuta - 17-02-2021 بارك الله فيك اخي محمد عبد العزيز جاري التجربة ... [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] ![]() تمت التجربة
![]() جزاك الله كل خير [size=small]أخي الكريم محمد عبد العزيز [/size] جاري فهم الكود السريع .. ![]() |