Create an array to hold combobox file names in vb6

Never Know how many lines in combox
Current Names in combobox
01-03-2016.rtf
02-20-2016.rtf
03-10-2016.rtf
07-26-2016.rtf
09-25-2015.rtf
1-3-2016.rtf
11-18-2015.rtf
11-29-2015.rtf
12-25-2015.rtf
3-10-2016.rtf
9-17-2015.rtf
9-25-2015.rtf
Yr01-10-2016.rtf
Yr06-23-2016.rtf
Yr08-03-2016.rtf
Yr09-09-2016.rtf
Yr7-4-2016.rtf
Yr8-22-2016.rtf
Yr8-3-2016.rtf
i plan on only copying the date parts of the names to the array.
have very little experience with arrays
how to write this ?
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Dim MyArray() As String
Dim lngIndex As Long
Dim intPos As Integer
ReDim MyArray(Combo1.ListCount - 1)

For lngIndex = 0 To Combo1.ListCount - 1
    intPos = InStrRev(Combo1.List(lngIndex), ".")
    MyArray(lngIndex) = Mid$(Combo1.List(lngIndex), 1, intPos - 1)
Next

Open in new window

0
Martin LissOlder than dirtCommented:
If you don't want the "Yr" part in your array then add this line after line 8

    MyArray(lngIndex) = Replace(MyArray(lngIndex), "Yr", "")
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks Marty, works perfect
0
Martin LissOlder than dirtCommented:
You're welcome.
0
isnoend2001Author Commented:
Now that i got valid dates to wok with, not sure how to use them, hopefully you can help I will post a new question. just switched from xp to win 7  so not sure how to do it. liked xp a lot more with no restrictions
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.