You can write a function (function) or subroutines (sub) expression under the (expression) lambda as simple iso container as determining variable. Under which we can write a function or method that already exists. Writing functions or subroutines in the Lambda expression can not be set to a function or method, which is another advantage. For the method. Let me illustrate the comparison between A simple function to write a lambda function for finding iso container Factorial Module Module1 Sub Main () Dim nResult AS Long nResult iso container = Factorial (5) Console.WriteLine iso container (nResult) 'value is 120 End Sub Function Factorial (ByVal number As. Long) As Long If number <= 1 Then Return (1) Else Return number * Factorial (number - 1) End If End Function End Module for the finding Factorial by writing an expression statement Lambda Module Module1 Sub Main () Dim nResult. As Func (Of Long, Long) = Function iso container (number As Long) If number <= 1 Then Return (1) Else Return number * nResult (number - 1) End If End Function Console.WriteLine (nResult.Invoke (5)). 'value is 120 End Sub End Module.
2013 (5) September (1) July (1) June (1) April (2) 2012 (16) September (1) July (2) June (1) May (2). April (2) March (2) February (1) January (5) 2011 (12) December (1) November (2) August (1) June (2) May (1). February (2) January (3) 2010 (24) December (6) November (2) VB.Net Lambda VB.Net with Form catch the SplitContainer October (2) September (6) August (. 4) July (1) February (1) January (2) 2009 (3) December (1) February (1) January (1) 2008 (6) November (1) October (. 2) August (1) March (1) February (1) 2007 (12) December iso container (1) November (1) October (2) August (1) July (2) June (. 1) May (3) April (1).
Loading ...
12 Dec 2552 starting.
No comments:
Post a Comment