问题描述
大家好!
VB.NET增加了创建仅在
块中可见的变量的功能。块是代码的任何部分,以一个单词
End,Loop或Next结尾。这个
表示For ... Next和If ... End If块可以拥有自己的
变量。
所以,
虽然y> 6
Dim x as interger
......
结束时
但是x具有生命周期的程序级别。手段,
Dim x as interger - 这条线路的效果。仅在第一时间。是吧
对吗?
谢谢&问候
Elankathir,
B''lore,
印度。
***通过开发人员指南发送***
不要只参加USENET ......获得奖励!
Hi all !
VB.NET adds the ability to create variables that are visible only within
a block. A block is any section of code that ends with one of the words
End , Loop , or Next . This
means that For...Next and If...End If blocks can have their own
variables.
So,
While y>6
Dim x as interger
......
End while
But x have lifetime of procedure level. Means,
Dim x as interger -- This line geting eff. at first time only. is it
right ?
Thanks & Regards
Elankathir,
B''lore,
India.
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!
这篇关于关于块级范围&可变寿命的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!