Results 1 to 3 of 3

Thread: HELP!!! How do I?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    I need to declare a variable that will store the path and filename of each file the gets added to a listbox. I have no idea how many files there will be so it needs to be dynamic. I have no clue how to do this or if it is even possible. Please help and thanks for your help in advance.
    Using VB6 Still Pluging away

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    The best thing to use here is a collection. declare it like this
    Code:
    Dim collMyCollection as Collection
    then add the items like this

    Code:
    Dim i As Integer
    
    Set collMyCollection = New Collection
    
    For i = 0 To List1.ListCount - 1
    
        collMyCollection.Add List1.List(i)
    
    Next i
    then Dim i As Integer

    Set collMyCollection = New Collection

    For i = 0 To List1.ListCount - 1

    collMyCollection.Add List1.List(i)

    Next i.Item(x) will give you the xth item on the list.



  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85
    Thanks for the help. I'm going to try this tomorrow so I'll let you know how it goes. Do you know where I can get more info on collections and how they work??
    Using VB6 Still Pluging away

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width