请问在VB中,如何将文本框中的数字读取到数组中啊?

2024-11-18 14:58:32
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Text1.Text = "123,456,789"
Dim a
a = Split(Text1.Text, ",")
Dim b
ReDim b(0 To UBound(a)) As Integer
Dim i As Integer
For i = 0 To UBound(b)
b(i) = Val(a(i))
Print b(i)
Next i
End Sub