In VB.NET functions, you can return values ββin two ways. For example, if I have a function called "AddTwoInts" that takes two int variables as parameters, add them together and return a value that I could write to the function either as one of the following.
1) "Return":
Function AddTwoInts(ByVal intOne As Integer, ByVal intTwo As Integer) As Integer Return (intOne + intTwo) End Function
2) "Function = value":
Function AddTwoInts(ByVal intOne As Integer, ByVal intTwo As Integer) As Integer AddTwoInts = (intOne + intTwo) End Function
My question is this: is there a difference between the two or a reason for using one over the other?
Phen source share