<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
When we are already discussing new language features, what about
supporting iterators for array properties:<br>
<br>
<tt> TTest = class</tt><tt><br>
</tt><tt> // ...</tt><tt><br>
</tt><tt> property Objects[Index: Integer]: TObject read
GetObject <b>iterator GetObjectIterator</b>;</tt><tt><br>
</tt><tt> property ObjectCount: Integer read GetObjectCount;</tt><tt><br>
</tt><tt> end;</tt><tt><br>
</tt><br>
This would allow code like:<br>
<br>
<tt> for MyObject in Test.Objects do</tt><tt><br>
</tt><tt> //...<br>
<br>
</tt>In the LCL, e.g.:<br>
<tt><br>
procedure TForm1.Button1Click(Sender: TObject);<br>
var<br>
Comp: TComponent;<br>
begin<br>
for Comp in Components do<br>
//...<br>
end;<br>
</tt><br>
This should actually be pretty OK and should not cause any
regressions.<br>
<br>
Ondrej<br>
<tt></tt>
</body>
</html>