In an array of type TArrayParams that stores records of type TParams, according to the code below, there is a string field that can vary from 1 to 1000. How to check the length (in bytes) of memory that TArrayParams will have?
TParams = record
S: String; // Length may vary
I: Integer;
end;
TArrayParams = TArray<TParams>;
var arr: TArrayParams;
i: Integer;
begin
SetLength(arr, 2);
for i := 0 to 1 do
begin
arr[i].S := 'my random string.... xyz up to (maybe) 1000';
arr[i].I := i;
end;
// What is the length (in bytes) of the "arr" array's memory space?
SizeOf(arr) ??? It Doesn't work...
Length(arr) ??? It Doesn't work...
ByteLength(arr) ?? It Doesn't work...
end;