In practice, I'd like to write a procedure that add new value to the end of a dynamic value.
In case of integer array, I might write the procedure as:
type
TMyArr: TArray<integer>;
procedure AddValue(var Myarr: TMyArr; NewValue: integer);
begin
SetLength(MyArr, Length(MyArr) + 1);
MyArr[High(MyArr)] := NewValue;
end;
Can I write a generic procedure like
procedure AddValue(var arr:TArray<T>; AValue:<T>);
Hope that you understand what I mean. I'm aware of the issue of copying or referencing the contents of the dynamic array. I'll test it myself. Please comment on writing the generic procedure.