By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,614 Members | 2,491 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,614 IT Pros & Developers. It's quick & easy.

Is it possible to dynamically name a variable?

P: 2
Hi,

I'm trying to make an array with the data read from a file. I'm using get GetFiles to find the files in a directory and then I want to make an array for each file it finds. I tried something like this but it dont work. I dont know what I'm doing to be honest :)

If you can help me I'll be very grateful and if you ever need help programming in assembly I'm your man!

Dim index As Integer = 0
For Each FoundFile As String In My.Computer.FileSystem.GetFiles("c:\Program Files\Sites") ', "*.lkd")
index = index + 1
Dim "cparry"&index As String()
Dim cpreader As System.IO.StreamReader
cpreader = _
My.Computer.FileSystem.OpenTextFileReader(FoundFil e)
cboCarPark.Items.Add(cpreader.ReadLine())
Dim carparks As String()
carparks(0) = cpreader.ReadLine()
Next
Mar 15 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.