Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to know how i can turn a value of 5 into an array that = 0,1,2,3,4,5. I have a code that reads how many lines are in a file but i need to change that solid number in to a list or an array that starts with 0 and goes to the solid number in this case 5. help would be great.
Posted

From the question it appears that you want to create an array or list of size equal to the number of lines in the file. If the purpose is to store each line from the file into this array or list then System.IO.File.ReadAllLines method explained here http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx[^]
can be used, which reads each line from the file into the array by creating an array of size equal to the number of lines in the file.
 
Share this answer
 
VB
Dim strHeaps = 10

For i = 0 To strHeaps Step 1
    MsgBox(i & " is the number were at")
Next
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900