Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have been trying to fix a bit of code for the past few days but keep getting an error when I add the iterator phrase to my sub routines. An example of this is as follows:

VB
Public Iterator Function Matches() As IEnumerable(Of FileInfo)
    For Each rootPath As String In m_paths
        Dim path As String = rootPath.Trim()
        For Each fi As FileInfo In _matches(path)          
            Yield fi
        Next fi
    Next rootPath
End Function




At the top where my Function reads - Public iterator function Matches()
if the iterator word is not there then I cannot use the Yield property and if the iterator is there then the word Matches() goes to unused declaration and does not work? Can anyone shed some light as to why this is happening

Thank you in advance for your time :)
Posted
Updated 26-Nov-11 12:12pm
v3
Comments
Dale 2012 30-Nov-11 16:30pm    
There is really no error here I have figured out the problem and have resolved it thank you all

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