I have a function that will return any files in a given folder. But in order to make it also return files in subfolders, i was told i would have to make it recursive. Recursive functions are something ive never had to use yet...and quite frankly i dont understand them. Could someone tell me what modifications i would have to make to this function to make it return subfolder files as well?
VB Code:
  1. Function DirList(strDir As String) As String()
  2.     'returns a 0 based array with the files in strDir
  3.     'Can contain a pattern such as "*.*"
  4.     Dim Count As Integer
  5.     Dim sFiles() As String
  6.     Dim sFile As String
  7.    
  8.     sFile = Dir$(strDir)
  9.     Count = -1
  10.     Do
  11.         Count = Count + 1
  12.         ReDim Preserve sFiles(Count)
  13.         sFiles(Count) = sFile
  14.         sFile = Dir$
  15.     Loop
  16.     DirList = sFiles
  17. End Function
thanks,
Nishant