View Single Post
Old 11-16-2012, 02:21 PM   PM User | #8
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
As mentioned, when copying out of a list you should use a for or a while, not a do/while. Do while's indicate that its guaranteed to perform the first action, whilst your list is currently empty so you cannot retrieve the first item. You can use a try/catch of course.
It may be a lot easier to simply invoke the .clone() method on the primary list though and use that copy. Its shallow clone, but if its just for sorting for whatever reason than that is fine.

If the problem is adding to the collection, post that code.
Fou-Lu is offline   Reply With Quote