谢谢!!帮忙回答!!
Public Sub OneSwap(ByRef x As Integer, ByRef y As Integer)
Dim temp As Integer
temp = x
x = y
y = temp
End Sub
Public Sub TwoSwap(ByVal x As Integer, ByVal y As Integer)
Dim temp As Integer
temp = x
x = y
y = temp
End Sub
Private Sub Form_Click()
Dim x1 As Integer
Dim y1 As Integer
x1 = 1
y1 = 2
Form1.Print "x1 = ", x1
Form1.Print "y1 = ", y1
Form1.Print vbCrLf
Call OneSwap(x1, y1)
Form1.Print "x1 = ", x1
Form1.Print "y1 = ", y1
'----------------------------------------------------
Form1.Print vbCrLf
Form1.Print vbCrLf
Dim x2 As Integer
Dim y2 As Integer
x2 = 3
y2 = 4
Form1.Print "x2 = ", x2
Form1.Print "y2 = ", y2
Form1.Print vbCrLf
Call TwoSwap(x2, y2)
Form1.Print "x2 = ", x2
Form1.Print "y2 = ", y2
End Sub