Yes, it is possible, but you have to declare the parameter with a previously defined dynamic array type. you are currently using an open array instead.
type
TStrDynArray = array of string;
procedure DoSomeThing(in_cmd:string; var out_strs: TStrDynArray);
begin
SetLength(out_strs, 2 * Length(inn_cmd));
...
Or, use TArray<string>
if generics are available (from Delphi 2009)
procedure DoSomeThing(in_cmd:string; var out_strs: TArray<string>);
begin
SetLength(out_strs, 2 * Length(inn_cmd));
The reason for this is that array of x
in one context is not the same as array of x
in another context.
In a type declaration
type
TDynamicArray = array of string;
Is a dynamic array type, which can be resized. Dynamic arrays were introduced in Delphi 4.
In a parameter definition
procedure Test(var X: array of string);
Is an open array parameter which means that it will accept arrays of different sizes as input. It just takes a pointer (i.e. reference) to the first element, and the index of the last element in the array. It does not know or care whether the input array is a dynamic array or a static array, and thus will not allow the length to be resized.
Open array parameters predate Delphi 1.
Further reading
http://rvelthuis.de/articles/articles-openarr.html