Two problems with above code:Originally Posted by jdarling
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]
Bookmarks