Am 16.02.2011 14:59, schrieb Michael Schnell:
On 02/16/2011 01:59 PM, Graeme Geldenhuys wrote:

while itr.HasNext do
begin
i := itr.Next
... now do something with the Unicode character stored in i
end;
Do we already have / plan a dedicated iterator loop syntax for this

Delphi Prism would go

for each i in itrdo
begin
... now do something with the Unicode character stored in i
end;


for this

Take a look at the tforin*.pp tests here: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tests/test/

But basically the syntax is

for enumeratedvar in enumerator do
  // something

It's the Delphi compatible variant of the Prism syntax. Of course you also might need to define a suitable enumerator (e.g. for enumerating a UTF-8 string).

Regards,
Sven

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to