thecocce / delphi-orm

Automatically exported from code.google.com/p/delphi-orm
0 stars 0 forks source link

TDuckTypedList should be enumerable #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the GetEnumerator method instead of looking for property Items (only 
available in XE2) or GetItem/GetElement (only possible if these methods are 
public or published) would make this more flexible and compatible with older 
Delphi versions (actually I think DORM should have full XE support).

I was looking if there is some special place where specific items are accessed 
but it is always like for i := 0 to list.count -1 do list.GetItem(i)
This could be done with for item in list do if you implement the GetEnumerator 
in TDuckTypedList. Then also at least persisting data from a list could done 
with TEnumerable instead of having all the extra TList methods.

Original issue reported on code.google.com by sglienke@aagon.com on 2 Dec 2011 at 7:45

GoogleCodeExporter commented 9 years ago
See Function WrapAsList 

Original comment by daniele....@gmail.com on 17 Dec 2011 at 10:26