Rya*_*yan 24 delphi foreach delphi-2009
我已经读过Delphi应该为Delphi 9中的每个循环得到一个.这个功能是否已经成为语言?我的Delphi 2009 IDE似乎无法识别每种语法.这是我的代码:
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;
Run Code Online (Sandbox Code Playgroud)
da-*_*oft 46
procedure ProcessDirectory(p_Directory, p_Output : string);
var
files : TStringList;
filePath : string;
begin
files := GetSubfiles(p_Directory);
try
for filePath in files do
begin
// do something
end;
finally
files.Free;
end;
end;
Run Code Online (Sandbox Code Playgroud)
Joh*_*mas 26
是.
但它是为了......
尝试
var
s: string;
c: char;
begin
s:=' Delphi Rocks!';
for c in s do //<--- here is the interesting part
begin
Application.MainForm.Caption:=Application.MainForm.Caption+c;
Sleep(400); //delay a little to see how it works
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
37828 次 |
| 最近记录: |