
Collections, swapping items in a collection
Hi,
I can't seem to work out how to simply swap two items over in a
collection. I need to sort a collection of classes depending on the
value of a class property.
I've tried the following:-
1. First attempt
For rowCount = 1 To m_rows.Count - 1
Set currentRow = m_rows(rowCount)
Set nextRow = m_rows(rowCount + 1)
if currentRow.value < nextRow.value then
set tempRow = currentRow
set currentRow = nextRow
set nextRow = tempRow
This fails....
2. Clone method in the row class
This method is as follows
Public Sub clone(rowToClone as RowClass)
When i call this wuth "currentRow.clone(nextRow)"
This fails with "object does not suport this propety or method"
Any ideas? Or even better a easier way of doing this?
Thanks
Andy
Sent via Deja.com
http://www.*-*-*.com/