Hi All,
eg. "Array.Copy" method used to copy array elements.
Is there any method to copy collection objects data,
except iterating through original collection and then filling each element
into other collection, which is a lengthy process.
colBackupEmp = m_colEmp
Above statement sets the reference.
---------------------------------------------------------------------
Structure Employee
Dim ID As Integer
Dim Name As String
End Structure
Private m_colEmp As New Collection
Private m_colBackupEmp As New Collection
Private Sub LoadEmployee()
Dim Emp as Employee
Emp.ID = 100
Emp.Name = "John"
m_colEmp.Add (Emp)
Emp.ID = 200
Emp.Name = "Sam"
m_colEmp.Add (Emp)
End Sub
Private Sub BackupEmployeeData()
''''''' colBackupEmp = m_colEmp ''''''''
Dim Emp As Employee
For Each Emp In m_colEmp
m_colBackupEmp.Add (Emp)
Next
End Sub
---------------------------------------------------------------------
Thanks and Regards
Sakharam Phapale