How can I pass array of string a parameter to function in delphi
I have a problem with Delphi.
I wrote a function like this:
function MyFunction(arr: array of AnsiString): Boolean;
begin
//code here
end;
And now, when I pass an array of AnsiString directly into function, like this, everything works perfectly:
MyFunction(['one', 'two', 'three']);
But, when I try to store this array like this:
var arr: array of AnsiString;
procedure MyProcedure;
begin
arr[0] := ['one', 'two', 'three'];
MyFunction(arr[0]);
end;
There is a mismatch error.
I'm a beginner with Delphi, but this is really confusing.