Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
i => i > 2
Function(x) i > 2
Delegate Function SomeDelegate(ByVal i As Integer) As Boolean Public Sub SomeMethod()' 'REMEMBER FROM LAST TIME, THE KEY LINE IS THE FOLLOWING Dim sd As SomeDelegate = New SomeDelegate(AddressOf OtherMethod)' ' other code here YetOneMore(sd) End Sub Private Function OtherMethod(ByVal i As Integer) As Boolean Return i > 2 End Function Private Sub YetOneMore(ByVal f As SomeDelegate) Dim res As Boolean = f(5) Console.WriteLine(res.ToString()) End Sub
Dim sd As SomeDelegate = Function(i) i > 2