16,748
社区成员
发帖
与我相关
我的任务
分享
for I := 0 to BM.BillDetails.Count-1 do
begin
if (tmpType = BM.BillDetails.Items[i]._ItemID) then
begin
continue;//如果相邻的两个是一样的话,这个方法可以,但有可能就是两个不相邻!
end;
tmpType := BM.BillDetails.Items[i]._ItemID;
end;
procedure TForm1.Button1Click(Sender: TObject);
var a:array of Integer;
t:TStringList;
i:integer;
begin
t := TStringList.Create;
SetLength(a,9);
a[0]:= 1;
a[1] := 2;
a[2] := 3;
a[3] := 4;
a[4] := 2;
a[5] := 3;
a[6] := 1;
a[7] := 6;
a[8] := 7;
for i := 0 to Length(a) - 1 do
begin
if t.IndexOf(IntToStr(a[i])) = - 1 then
t.Add(IntToStr(a[i]));
end;
Memo1.Text := t.Text;
t.Free;
end;