Ok, nice, nice, but how to
access array elements if parameter is Pointer only? Array can be in any type.
With Furtbichler's routine signature you could have something like
Delphi-Quellcode:
procedure SwapArrayElements(aStartElement : Pointer; aElementSize, aElementCount : Integer);
var
p: PByte;
begin
p := AStartElement; // p points to first element
Inc(p, aElementSize); // Now p points to second element
Move(p^, ..., aElementSize); // Moves the element p points to
end;
(NB: These are only some building blocks of the routine, not the whole thing.
)