Registriert seit: 23. Mai 2007
117 Beiträge
Delphi 2006 Professional
|
Re: Ratlosigkeit bei Arrays/ Sortieren
29. Jun 2007, 12:07
Delphi-Quellcode:
var
SortArray: Array of Integer;
Delphi-Quellcode:
procedure ComputeAreaArray(ParentID: Integer);
var
i: Integer;
CurrentChildCount: Integer;
CurrentValues4: TCurrentValues;
begin
with CurrentValues4 do
begin
// initialize varaiables
CurrentValues4 := InitializeRecord(CurrentValues4);
CurrentChildCount := DoGetChildCount(ParentID);
SetLength(SortArray, CurrentChildCount+1);
// get sizes of every child and store this in an array
for i:= 0 to Length(SortArray)-1 do
begin
// get child value info for ParentID at child index i
CurrentChildID :=DoGetChildData(ParentID, i , CurrentChildValue, CurrentChildCaption, CurrentChildImageIndex);
// store child value in sort array at position i
SortArray[i] := CurrentChildValue;
end;
// size of ParentId ist stored at position 0
QuickSortRectangles(0, Length(SortArray)-1, False);
end;
end;
|
|
Zitat
|