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

牧云@^-^@ 提交于 2019-12-02 01:10:51

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.

That particular piece of documentation is wrong. Local variables declared in a Shared method are no different than locals declared in a non-Shared method. The only behavior difference for locals comes into play with they are declared with the Static modifier.

I'll alert the appropriate team about it.

EDIT

The team in charge of the documentation was alerted and will be correcting the documentation in the very near future.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!