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.

Mailing lists / fpc-pascal / 2010-01
5 messages · 2 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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.
Thanks.
An exhange() would be usefull. Should I file a bug report?
Please do, this way we won't forget it.
Michael.
Done.
http://bugs.freepascal.org/view.php?id=15517