Private x As Integer
来源:百度知道 编辑:UC知道 时间:2024/04/26 12:17:07
Private x As Integer
Private Sub Command1_Click()
Dim y As Integer
x = 5: y = 3
Call proc(x, y)
Label1.Caption = x
Label2.Caption = y
End Sub
Private Sub proc(ByVal a As Integer, ByVal b As Integer)
x = a * a
b = b + b
End Sub
的结果怎么会是 25 3
Private Sub Command1_Click()
Dim y As Integer
x = 5: y = 3
Call proc(x, y)
Label1.Caption = x
Label2.Caption = y
End Sub
Private Sub proc(ByVal a As Integer, ByVal b As Integer)
x = a * a
b = b + b
End Sub
的结果怎么会是 25 3
有没有看到proc函数参数列表中形参b前面的ByVal关键字?它表示按值传递,它是不会改变传过来的实参y的值的。
把关键字ByVal改为ByRef,即按址传递,那结果就会是:25 6
b = b + b..
所以y就还是等于3的啊...
Private x As Integer
in private, as individud 怎样区别?
in private
Private Sub Form_Unload(Cancel As Integer)
Private Sub WskServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
VB 按键事件如:Private Sub form_Keypress(KeyAscii As Integer)
Private WithEvents Timer1 As Timer这个VB代码是什么意思
in addition to; as well as; besides
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long运行出现错误