过程的调用
Private Sub Command1_Click()Dim k As Integer, m As Integer
Dim p As Integer
k=4: m=1
p=PC(k, m) : Print p;
p=PC(k, m) : Print p
End Sub
Private Function PC(a As Integer, b As Integer)
Static m As Integer, i As Integer
m=0: i=2
i=i + m + 1
m=i + a + b
PC=m
End Function
sub inc(a as integer)
static x as integer
x=x+a
print a;
end sub
private sub command1_click
inc 2
inc 3
inc 4
为什么第一个程序function调用第一次是p=8,第二次结果还是8???
而在第二个程序调用sub过程中结果却是 2,5,9????
[ 本帖最后由 easonzgf 于 2014-12-11 13:11 编辑 ]