Did Delphi ever get a for each loop?

Posted by Ryan on Stack Overflow See other posts from Stack Overflow or by Ryan
Published on 2010-04-19T16:40:41Z Indexed on 2010/04/19 16:43 UTC
Read the original article Hit count: 289

Filed under:
|
|

Hello,

I've read that Delphi was supposed to get a for each loop in Delphi 9. Did this functionality ever make it into the language? My Delphi 2009 IDE doesn't seem to recognize the for each syntax. Here's my code:

  procedure ProcessDirectory(p_Directory, p_Output : string);
  var
    files : TStringList;
    filePath : string;
  begin
    files := GetSubfiles(p_Directory);
    try
      for (filePath in files.Strings) do
      begin
        // do something
      end;

    finally
      files.Free;
    end;
  end;

© Stack Overflow or respective owner

Related posts about delphi

Related posts about foreach