[求助] 数组为何没有被赋值
我编写了这样一个程序,为什么数组的值在输入后仍然为零?请教一下高手!
Dim ND(20), T(20) As Double
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Label3.Caption = Label3.Caption + vbLf + Text1.Text
Text1.Text = ""
i = i + 1
ND(i) = Val(Text1.Text)
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Label4.Caption = Label4.Caption + vbLf + Text2.Text
Text2.Text = ""
j = j + 1
ND(j) = Text2.Text
End If
End Sub