Hey all-
New here, new to VB.net, but no stranger to programming/OOP concepts. I'm just trying to figure out how to adapt my existing knowledge of loops, data population, etc into this rather odd, plain-english language.
I'm using VB.NET, Studio 2008, if that helps.
I'm attempting to make a class of helper functions, the one I'm having problems with in particular is one that loops through a directory, storing the filenames in an ArrayList.
Incomplete code heading to what I'm after...
It's strange though, cause if I Debug.Write out f, the Intermediate Window shows the correct result of what I'd like to add to the ArrayList. So I'm unclear somewhere along the line of how A) The .Add function works (in this case doesnt), and B) Returning the list into a variable outside this class.
As a disclaimer, I still have no idea the differences between a lot of the TLA's associated with the .NET framework, so I'm hoping this is all in the right place.
New here, new to VB.net, but no stranger to programming/OOP concepts. I'm just trying to figure out how to adapt my existing knowledge of loops, data population, etc into this rather odd, plain-english language.
I'm using VB.NET, Studio 2008, if that helps.
I'm attempting to make a class of helper functions, the one I'm having problems with in particular is one that loops through a directory, storing the filenames in an ArrayList.
Incomplete code heading to what I'm after...
VB.NET:
Public Class DirReader
Dim fList As ArrayList = New ArrayList
Function FilesList(ByVal dir As String) As ArrayList
For Each f As String In Directory.GetFiles(dir)
'add to the fList array
fList.Add(f.Substring(dir.Length, f.Length - dir.Length))
Next
Return fList
End Function
End Class
As a disclaimer, I still have no idea the differences between a lot of the TLA's associated with the .NET framework, so I'm hoping this is all in the right place.