Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#14

Re: Aus Dynamischen Array Hersusschneiden.

  Alt 3. Sep 2006, 19:57
Also ich weiß nicht obs schon gesagt wurde aber ich mache es einfach so:

Delphi-Quellcode:
procedure DeleteItem(var AArray: TArrayofKa; Index: Integer);
var tmp: TArrayofKa;
    i,j: Integer;
begin
  j:= 0;
  SetLength(tmp,Length(AArray)-1);
  for i:= 0 to High(AArray) do
   if i <> Index then
   begin
    tmp[j] := AArray[i];
    inc(j);
   end;
   AArray := tmp;
end;
So in etwa

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat