[fpc-pascal] For-in-loop question about GetEnumerator

Jürgen Hestermann juergen.hestermann at gmx.de
Sat May 17 13:18:01 CEST 2014


Am 2014-05-17 10:39, schrieb Mattias Gaertner:
> I added a note to the example, that the enumerator is automatically freed by the compiler after the loop.


I just had a look at the UTF8 example on http://wiki.freepascal.org/for-in_loop where is says:

------------------------------------------------
for i := 1 to Length(s) do
      DoSomething(ch[i]);
------------------------------------------------

Isn't this wrong as i iterates over bytes but but not over (UTF8) characters?



More information about the fpc-pascal mailing list