Link to home
Start Free TrialLog in
Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on

vb6List Question

What is the best way to write all selected items in a list box to an array.  Here is what I have:

        
    'get races to assign to
    k = 0
    ReDim RacesToAssign(0)
    For i = 0 To lstRaces.ListCount - 1
        If lstRaces.Selected(i) = True Then
                    RacesToAssign(k) = lstRaces.Text
                    k = k + 1
                    ReDim Preserve RacesToAssign(k)
        End If
    Next i

Open in new window

SOLUTION
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017