vb编程 Call q(1,i):Call q(2,j):Call q(3,k):Dim i As Integer,j As Integer,k As Integer,h As IntegerPrivate Sub Form_click()i = 0:j = 1:k = 2Call q(1,i):Print i; j; kCall q(2,j):Print i; j; kCall q(3,k):Print i; j; kEnd SubPrivate Sub p(i)i = i + 1:P
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/09 05:16:53
vb编程 Call q(1,i):Call q(2,j):Call q(3,k):Dim i As Integer,j As Integer,k As Integer,h As IntegerPrivate Sub Form_click()i = 0:j = 1:k = 2Call q(1,i):Print i; j; kCall q(2,j):Print i; j; kCall q(3,k):Print i; j; kEnd SubPrivate Sub p(i)i = i + 1:P
vb编程 Call q(1,i):Call q(2,j):Call q(3,k):
Dim i As Integer,j As Integer,k As Integer,h As Integer
Private Sub Form_click()
i = 0:j = 1:k = 2
Call q(1,i):Print i; j; k
Call q(2,j):Print i; j; k
Call q(3,k):Print i; j; k
End Sub
Private Sub p(i)
i = i + 1:Print i; j; k
End Sub
Private Sub q(ByVal h,j)
i = j
If h = 0 Then
Call p(j)
Else
If h = 1 Then Call p(i) Else j = j + 1
End If
End Sub
Call q(1,i):Call q(2,j):Call q(3,k):怎样传递的?
还有形参h对应的实参是什么,为什么又会有i 呢
vb编程 Call q(1,i):Call q(2,j):Call q(3,k):Dim i As Integer,j As Integer,k As Integer,h As IntegerPrivate Sub Form_click()i = 0:j = 1:k = 2Call q(1,i):Print i; j; kCall q(2,j):Print i; j; kCall q(3,k):Print i; j; kEnd SubPrivate Sub p(i)i = i + 1:P
Call q(1, i): Call q(2, j): Call q(3, k): 这些是调用子程序
若变量前有byval就是值传递,比如Call q(1, i).i=0,即把1和0分别赋给子程序中的h,j.
形参h对应的实参是在调用的时候第一个传入的值.比如:Call q(2, j)这里2是第一个传入的数,所以就是形参h对应的实参.再比如Call q(3, k).这里3是第一个传入的数,所以3就是h的实参.
这个代码是利用随着变量i 的改变来实现输出各组不同的数.应该是测试什么东西用的.