MSDN documentation error? “If the procedure is Shared, all its local variables are automatically shared. This includes the Static variables.”

前端 未结 2 1757
温柔的废话
温柔的废话 2021-01-21 19:22

I was reviewing the MSDN documentation on VB.Net\'s little-used Static keyword for local variables. My question is not about how Static works (I personally plan

2条回答
  •  再見小時候
    2021-01-21 19:47

    No, it's talking nonsense. It continues being utterly broken in the next paragraph:

    If the procedure is not Shared, its local variables are instance variables.

    Local variables aren't instance variables...

    Whoever wrote that page appears not to understand local variables at all. Goodness knows what they'd make of recursion. Mind you, it starts off reasonably:

    Normally, a local variable in a procedure ceases to exist as soon as the procedure stops.

    ... but that statement is clearly in contradiction to the later ones. Sigh.

    I suggest you file a bug on Connect.

提交回复
热议问题