一条vb题,请高手帮忙?解决办法
一条vb题,请高手帮忙???????????
窗体上有Text1,Text2及一个Command1控件,
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x = 2
Text1.Text = Fun2(Fun1(x), y)
Text2.Text = Fun1(x)
End Sub
Private Function Fun1(x As Integer) As Integer
x = x + y: y = x + y
Fun1 = x + y
End Function
Private Function Fun2(x As Integer, y As Integer) As Integer
Print x, y
Fun2 = 2 * x + y
End Function
当单击1次和单击2次,Text1和Text2的结果????
------解决方案--------------------
1次 10 10
2次 58 58
窗体上有Text1,Text2及一个Command1控件,
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x = 2
Text1.Text = Fun2(Fun1(x), y)
Text2.Text = Fun1(x)
End Sub
Private Function Fun1(x As Integer) As Integer
x = x + y: y = x + y
Fun1 = x + y
End Function
Private Function Fun2(x As Integer, y As Integer) As Integer
Print x, y
Fun2 = 2 * x + y
End Function
当单击1次和单击2次,Text1和Text2的结果????
------解决方案--------------------
1次 10 10
2次 58 58