取其他函数里某个变量的值
大家帮帮我,我是菜鸟public sub xyz()
If x <= List.ListCount Then
x=x+1
end if
Call insert
end sub
Public Sub insert()
用什么语句可以取得上面x执行完if后的值
end sub
Public Sub xyz(ByRef x As Integer)
If x <= List.ListCount Then
x=x+1
End if
Call insert
End sub
Public Sub insert()
Dim y As Integer
Call xyz(y)
Print y '//得到你要得结果
End sub
Public Sub xyz()
If x <= List.ListCount Then
x = x + 1
End If
Call insert(x)
End Sub
Public Sub insert(y As Integer)
Print y
End Sub
两个都是控件的事件
就将x定义全局变量,或者模块级变量
[此贴子已经被作者于2007-9-14 15:24:03编辑过]
过程内的变量是不公开也是不可能公开的。可以尝试让别的变量公开然后进行修改。