yea, but i dont have se or sw or ne ANYWHERE in my posts
Printable View
yea, but i dont have se or sw or ne ANYWHERE in my posts
Did you try to read this?
Quote:
The pattern searches for something in brackets, and ending with either nw, se, sw, ne. Not sure if they are constant, directions, or some tech lingo that could change... beats me... so if they are not directions, feel free to harp on me for my tech stupidity... if they are always nw, then just remove the other options in the pattern
StringArray(0) is your first line.Quote:
Originally Posted by ethanhayon
StringArray(1) is your second line.
Etc., through (the upper bound of StringArray) - 1, which is your last line.
The code is telling me that peek is not declared, how would i do this
NPassero just mistakenly left out a "." in there.
.Peek
http://msdn2.microsoft.com/en-us/lib...ek(vs.80).aspx
sorry about that.Quote:
Originally Posted by nmadd
but i did it on purpose.
its also telling me that add is not a member of system.array
If you are speaking of NP's code,
he wrote ArrayList, not Array.
its giving me an error here:
thats where its telling me that add is not a member f system.arrayCode:StringArray.Add(.ReadLine)
I see that there has been a little misstake in the declaration of the arraylist:
VB Code:
Dim StringArray() as New ArrayList
this will create an array of arraylists, and i belive thats not what you want right?
Just remove the ():
VB Code:
Dim StringArray as New ArrayList
Attachment 57938
The attached image is the error that i am getting. There is clearly more than one line in the text file, it only works when i do line (0)
Any Ideas?
Attachment 57939
sorry, i forgot to attach the error
You have to put that messagebox after the loop. Imagine the first iteration in the loop, one line has only been added to the ArrayList, yet you try to show the second line, index will always be out of range then.
An array is zero based meaning that it starts at 0 and then continues from there. So when you add that first item it goes into the slot StringArray(0) not StringArray(1), which is still empty because it has not been filled yet. Hope that clears it up a little bit.