VB.NET function return value [duplicate]
Possible Duplicate:
VB.NET Function Return
If I have a function that returns a boolean, what is the difference between:
Return False
and
Function = False
Return False
immediately exits the function so nothing further is executed.
Setting FunctionName = False
allows the return value to be assigned again before the function exits.
Personally I'd stick with Return
as it's much clearer what you're trying to do. Assigning to the function name is left over from VB6.
the Return statement also exits the function. Assigning a value to the function name does not. Your function will keep executing until the end, so you could potentially change that value again.
精彩评论