copy collection

justplainsoccer

Newcomer
Joined
Dec 3, 2003
Messages
14
how would i go about setting a collection equal to another collection. for example, i pass a parameter into a sub, then use a select case to set a general collection equal to a specific collection. make sense? probably not. heres what ive got so far.

Visual Basic:
Private Sub NameCollection(ByVal Which As Short)
    'gives the generic object 'collectionOb' a specific value depending on the selected tab
    Select Case Which
        Case 1
            collectionOb = keyCol
        Case 2
            collectionOb = accCol
        Case 3
            collectionOb = denyCol
    End Select
End Sub

(collectionOb is public)
 
i define collectionOb up at the top.
Visual Basic:
Public Class SettingsForm
    Inherits System.Windows.Forms.Form
    Dim collectionOb As Object
    Dim errStr, fileString As String
What collection are you using with this routine?

What do you mean?
 
Just reread your post and I think I jet what you mean now.

in the snippet

Visual Basic:
 Case 1
            collectionOb = keyCol
        Case 2
            collectionOb = accCol
        Case 3
            collectionOb = denyCol

where are keyCol, accCol and denyCol defined? Also is there a reason you are defining collectionOb as an object rather than a collection?
 
they are declared in the "MainModule".
publicly.

Visual Basic:
    Public keyCol As New Collection
    Public accCol As New Collection
    Public denyCol As New Collection
 
Back
Top