[fpc-pascal] Swopping two items in TCollection

Wimpie Nortje wimpienortje at gmail.com
Thu Jan 14 16:19:19 CET 2010


Thanks.

An exhange() would be usefull. Should I file a bug report?

Michael Van Canneyt wrote:
>
>
> On Thu, 14 Jan 2010, Wimpie Nortje wrote:
>
>> Hi list
>>
>> I have a class derived from Tcollection, holding items derived from 
>> TCollectionItem. How do I swop two items in the collection? FItem is 
>> of type TList which has an exchange function, but that is private and 
>> not accessable to me.
>
> You can set the Items' Index property.
>
> Maybe we should introduce a method Exchange(I,J : Integer) which does 
> this
> automatically in 1 go.
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list