A long time ago, the for ... in statement was added to the structured statements part of the Delphi language. It is a really powerful statement, that allows for code like this:
var
Line: string;
begin
for Line in MyMemo.Lines do
// some business logic
end;
in stead of using the traditional for statement which needs an extra LineIndex variable and an assignment statement:
var
LineIndex: Integer;
Line: string;
begin
for LineIndex := 0 to MyMemo.Lines.Count do
begin
Line := MyMemo.Lines[LineIndex];
// some business logic
end;
end;
So, “for … in” is a cool feature, but now I wanted to do the same for a TPageControl:
Read the rest of this entry »









