[二级VB试题天天练]VB考试试题17
分类: 计算机
时间: 2023-01-03 07:47:51
作者: 全国等级考试资料网
22.过程函数练习(3)
再来看看用数组作为参数的用法——
Private Sub Command1_Click()
Dim intA(1 To 4) As Integer
Dim i As Integer
For i = 1 To 4
intA(i) = i
Next
Call Proc1(intA())
For i = 1 To 4
Print intA(i)
Next
End Sub
Private Sub Proc1(B() As Integer)
Dim i As Integer
For i = 1 To 4
B(i) = 2 * i
Next
End Sub
再来看看用数组作为参数的用法——
Private Sub Command1_Click()
Dim intA(1 To 4) As Integer
Dim i As Integer
For i = 1 To 4
intA(i) = i
Next
Call Proc1(intA())
For i = 1 To 4
Print intA(i)
Next
End Sub
Private Sub Proc1(B() As Integer)
Dim i As Integer
For i = 1 To 4
B(i) = 2 * i
Next
End Sub