开发者

VB.NET function return value [duplicate]

This question already has answers here: 开发者_运维知识库 Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜