Public x
Dim y
Private z
Sub test108()
For i = 1 To 3
Debug.Print "第" & i & "次"
test1008
test1009
test1010
Debug.Print
Next
End Sub
Sub test1008()
Dim a As Byte
Static b As Byte
'别在测试时重新赋值,至少赋值也不应该在这个sub内,而应该有个专门赋初值的地方
'a = 1
'b = 1
'x = 1
'y = 1
'z = 1
a = a + 1
b = b + 1
x = x + 1
y = y + 1
z = z + 1
Debug.Print " a= " & a;
Debug.Print " b= " & b;
Debug.Print " x= " & x;
Debug.Print " y= " & y;
Debug.Print " z= " & z
End Sub
Sub test1009()
a = a + 1
b = b + 1
x = x + 1
y = y + 1
z = z + 1
Debug.Print " a= " & a;
Debug.Print " b= " & b;
Debug.Print " x= " & x;
Debug.Print " y= " & y;
Debug.Print " z= " & z
End Sub
Sub test1010()
a = a + 1
b = b + 1
x = x + 1
y = y + 1
z = z + 1
Debug.Print " a= " & a;
Debug.Print " b= " & b;
Debug.Print " x= " & x;
Debug.Print " y= " & y;
Debug.Print " z= " & z
End Sub