Record mit generischer Liste

Uses Generics.Collections;

Type
TMyRecord = Record
Fstring : String;
Fint : Integer;
End;

Tmylist = Tlist;

Var
MyList : TMyList;
MyRecord:TMyRecord;
I: integer;
Begin
myList := TMyList.Create;
MyRecord.fstring := 'Test';
MyRecord.Fint := 1234;
MyList.Add(MyRecord);
...

For MyRecord in MyList do
Writeln(MyRecord.fstring);
...

MyList.Free;
...

Schreibe einen Kommentar