VB的问题 请大家帮帮我啊

来源:百度知道 编辑:UC知道 时间:2024/06/02 03:58:38
Option Explicit
Dim x As Integer, y As Integer
Private Sub form_click()
Dim a As Integer, b As Integer
a = 5: b = 3
Call sub1(a, b)
Print a, b
Print x, y
End Sub

Private Sub sub1(ByVal m As Integer, n As Integer)
Dim y As Integer
x = m + n: y = m - n
m = fun1(x, y)
n = fun1(y, x)
End Sub

Private Function fun1(a As Integer, b As Integer) As Integer
x = a + b: y = a - b
Print x, y
fun1 = x + y
End Function

请问第一行显示的10,8 怎么计算出来的啊 我算来算去都是10,6啊

我知道运算的步骤啊 可是就是得不出答案 谁能仔细点说一下啊谢谢啦

你一步一步的来。真到 (到数第三句)。他就在显示 10,8

如果你真没看出来.你可以 按F8 。出现窗体。再点击。发生窗体的click事件。接下来你一直按F8。你就可以清楚的看到VB执行代码的顺序