Is it possible to pass to a function or procedure a dynamic array as optional parameter ? If yes, how ?
I have tried in this way :
procedure testp (str : string; var arr : StringArray = nil);
begin
str := 'Ciao Alessio !';
SetLength(arr, 2);
arr[0] := 'Ale';
arr[1] := 'Ale';
end;
but it gives : default parameter 'arr' must be by-value or const .
I'm using Delphi 7, but if not possible with Delphi 7, is it possible with newer version of Delphi or Free Pascal ?