I have an application in Visual Basic.Net and need to find all elements within an array which meet a certain condition.
Dim result As my_obj() = Array.FindAll(lstData, HasToBeSent)
Where the function HasToBeSent is defined like this:
Private Function HasToBeSent(ByVal cta As my_obj) As Boolean
Return cta.IsSent
End Function
However this doesn't compile, it says I haven't specified an argument for the parameter cta in Private Function HasToBeSent(ByVal cta As my_obj) As Boolean
I am using Visual Studio 2005, therefore I have VB.Net 8.0. I am guessing the suggested answer is for higher versions of VB.Net. Because when I replace the previous code with
Dim result As my_obj() = Array.FindAll(lstData, Function(cta) HasToBeSent(cta))
It says: "expression expected"
How can I solve this?