Dim n As Integer
n = 0
If n = 1 Then
Dim strName As String
strName = "Name"
Else
Debug.Print strName
End If
Debug.Print strName
以上我在给实际中发现的,大家可以复制到vb中实验一下,来讨论这个究竟是什么原因,这样的代码为什么会正确!
...全文
403打赏收藏
***********奇怪的代码*************奇怪的现象************
Dim n As Integer n = 0 If n = 1 Then Dim strName As String strName = "Name" Else Debug.Print strName End If Debug.Print strName 以上我在给实际中发现的,大家可以复制到vb中实验一下,来讨论这个究竟是什么原因,这样的代码为什么会正确!