Quote Originally Posted by jdarling
[pascal]procedure RunArray(A : Array of Byte);
var
I : Integer;
A : Array of byte;
begin
for I := 0 to Length(A) -1 do
DoSomething(A[I]);
end;[/pascal]
Two problems with above code:

1. A declared twice so it won't compile in Delphi
2. The parameter is passed by value, which means it is copied every time.

This version which should be as fast as pchar:

[pascal]procedure RunArray(const A : Array of Byte);
var
I : Integer;
begin
for I := 0 to Length(A) -1 do
DoSomething(A[I]);
end;[/pascal]