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

2014-05-17 Thread Mattias Gaertner
On Sat, 17 May 2014 13:18:01 +0200 Jürgen Hestermann wrote: > > 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.freepa

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

2014-05-17 Thread Jürgen Hestermann
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: --

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

2014-05-17 Thread Mattias Gaertner
On Fri, 16 May 2014 23:13:43 +0200 Krzysztof wrote: > Hi, > > This article is quite clear for me: http://wiki.freepascal.org/for-in_loop I added a note to the example, that the enumerator is automatically freed by the compiler after the loop. Mattias ___

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

2014-05-16 Thread Krzysztof
Thanks! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2014-05-16 Thread Mattias Gaertner
On Fri, 16 May 2014 23:13:43 +0200 Krzysztof wrote: >[...] > This article is quite clear for me: http://wiki.freepascal.org/for-in_loop >[...] > ... then FList.GetEnumerator create new object > (TListEnumerator.Create(Self)). My question is, where it is freed? Is it > freed automatically on runti

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

2014-05-16 Thread silvioprog
2014-05-16 18:13 GMT-03:00 Krzysztof : > Hi, > > This article is quite clear for me: http://wiki.freepascal.org/for-in_loop > > But let say that I have this class: > > TMyList = class > private > FList: TList > public > constructor Create; > destructor Destroy; > > procedure Add; > proce

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

2014-05-16 Thread Krzysztof
Hi, This article is quite clear for me: http://wiki.freepascal.org/for-in_loop But let say that I have this class: TMyList = class private FList: TList public constructor Create; destructor Destroy; procedure Add; procedure Remove; end; Now I want to do: for a in MyClass do begin e