VB中文本框中内容写入数组中
发布网友
发布时间:2023-08-24 23:16
我来回答
共4个回答
热心网友
时间:2024-11-24 07:19
Private Sub Form_Click()
ReDim a(Len(Text1.Text)) As Long
Dim b%, c%
b = 0
For i = 1 To Len(Text1.Text)
b = b + 1
If i = Len(Text1.Text) Then
a(c + 1) = Mid(Text1.Text, i - b + 1, b)
Print a(c + 1)
End If
If Mid(Text1.Text, i, 1) = "," Then
c = c + 1
a(c) = Mid(Text1.Text, i + 1 - b, b)
b = 0
Print a(c)
End If
Next
End Sub
热心网友
时间:2024-11-24 07:19
Private Sub Command1_Click()
Dim n
Dim a(1 To 5)
n = Split(Text1.Text, ",")
On Error Resume Next
Print "a(1) =" & n(0)
Print "a(2) =" & n(1)
Print "a(3) =" & n(2)
Print "a(4) =" & n(3)
Print "a(5) =" & n(4)
或
Private Sub Command1_Click()
Dim a(), i As Integer
a = Split(Text1.Text, ", ")
ReDim Preserve a(UBound(a) + 1)
For i = 1 To UBound(a)
a(i) = a(i - 1)
Next
End Sub
End Sub
热心网友
时间:2024-11-24 07:19
Private Sub Command1_Click()
Dim a(), i As Integer
a = Split(Text1.Text, ", ")
ReDim Preserve a(UBound(a) + 1)
For i = 1 To UBound(a)
a(i) = a(i - 1)
Next
End Sub
热心网友
时间:2024-11-24 07:20
分隔符$=","
A=split( text1.text, 分隔符$ )