Thanks! Im planning better examples to demonstrate the power of this function.
program Test;
uses TypeUtils, SysUtils;
type
TEmployee = record
FName: ShortString;
FId: LongInt;
FSalary: Currency;
end;
var
Employees: array of TEmployee;
I: LongInt;
begin
SetLength(Employees, 10);
for I := 0 to High(Employees) do
begin
with Employees[I] do
begin
FName := 'John Doe ' + I.ToString;
FId := I;
FSalary := 2000.25 * I;
end;
end;
WriteLn(ToStr(Employees, TypeInfo(Employees)));
end.
outputs:
[('John Doe 0', 0, 0), ('John Doe 1', 1, 2000.25), ('John Doe 2', 2, 4000.5), ('John Doe 3', 3, 6000.75), ('John Doe 4', 4, 8001), ('John Doe 5', 5, 10001.25), ('John Doe 6', 6, 12001.5), ('John Doe 7', 7, 14001.75), ('John Doe 8', 8, 16002), ('John Doe 9', 9, 18002.25)]