' Visual Basic 2008 9.0 .NET Examples - Lambda Expressions - New in Visual Basic 2008 - 9.0 : Public Class Example5 Public Delegate Function SomeDelegate(ByVal value As Integer) As Integer Public Shared Sub Main() Dim delegate1 As SomeDelegate = Function() 1 Console.WriteLine(delegate1.Invoke(123)) ' Dim delegate2 As SomeDelegate = Function() 2S Console.WriteLine(delegate2.Invoke(123)) ' 'Dim delegate3 As SomeDelegate = Function() 3L ' (1) ' Dim delegate4 As SomeDelegate = Function(value As Long) 4 Console.WriteLine(delegate4.Invoke(123)) ' 'Dim delegate5 As SomeDelegate = Function(value As Short) 5 ' (2) ' Console.ReadLine() End Sub End Class ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.