Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with recursive file listing functions

Status
Not open for further replies.

barrykellett

Programmer
Mar 4, 2003
29
GB
The below snippet of code:

If includeFiles Then
For Each pattern As String In filePattern.Split(";"c)
al.AddRange(dirInfo.GetFiles(pattern))
Next
End If

Gives the error:
Compiler Error Message: BC30451: Name 'pattern' is not declared.

Source Error:

Line 39: If includeFiles Then
Line 40: ' a distinct search for each pattern in the list
Line 41: For Each pattern As String In filePattern.Split(";"c)
Line 42: al.AddRange(dirInfo.GetFiles(pattern))
Line 43: Next


I got the code here: Can someone please help me get this working :(
 
What if you declare the variable before and then loop thr the array the split leaves in teh string...
 
I tried this and then the code just doesnt work!
Did you read the article?
Ive stepped through the code and it seems logical, i just dont understand why its flagging this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top