VB中运用到计时器控件,请问如何将每个周期内产生的数据加以处理

2025-01-07 15:50:55
推荐回答(1个)
回答1:

Dim a(100000) As Single
Dim i As Long

Private Sub Form_Load()
Randomize
i = 0
End Sub

Private Sub Timer1_Timer()
i = i + 1
a(i) = Rnd
End Sub
Private Sub Command1_Click()
Dim x As Single
x = a(2) + a(3)
Print x
End Sub