[问题]请问以下代码如何不同?运行时结果为什么是一样的?
Public Function f(x As Integer)
Dim y As Integer
x = 20
y = 2
f = x * y
End Function
Private Sub Command1_Click()
Dim x As Integer
x = 10
y = 5
y = f(x)
Print x; y
End Sub
Public Function f(x As Integer)
Dim y As Integer
x = 20
y = 2
f = x * y
End Function
Private Sub Command1_Click()
Dim x As Integer
stastic x = 10
y = 5
y = f(x)
Print x; y
End Sub
第二段代码为什么不是输出:10 5 的?
谢谢回复!!!